-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Vue Devtools #116
Merged
Merged
feat: Vue Devtools #116
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
76d5ea2
feat: add dev-tools package with initial configuration and dependencies
s8n11c 50024f7
feat: implement dev-tools package with core functionalities and types
s8n11c 6510d2c
refactor: move helper functions to a new helpers.ts file
s8n11c 0058850
feat: enhance dev-tools with field type resolution and improved tagging
s8n11c b7626f0
feat: integrate checkbox support in dev-tools with registration
s8n11c bcb13df
feat: add radio field support to dev-tools with registration
s8n11c 7be32b5
fix: update import paths for dev-tools to use wildcard syntax
s8n11c 26cecb7
refactor: simplify dev-tools registration by removing formId parameter
s8n11c eb7ccb2
chore: update package name
logaretm 76e4bba
refactor: simplify the API
logaretm 046d840
refactor: use the new api calls and add devtools as dep
logaretm 4193341
fix: eliminate circular dependency
logaretm 6c9509f
feat: hook all fields to devtools
logaretm 4d51c8f
fix: remove standalone tag
logaretm 2065079
chore: test playground forms with no forms
logaretm d0e108d
fix: ensure fields appear on mount
logaretm 0fb1ef7
fix: added klona and typefest as deps for devtools
logaretm 23c3687
chore: ensure klona is external to devtools
logaretm f8ac836
chore(playground): remove build failures
logaretm 16060d9
chore: match fw version
logaretm a6153e9
chore: added changeset
logaretm c3a8842
fix: only register fields on mounted
logaretm c0a7ccf
fix: delay registeration logic
logaretm 4f3b55d
feat: branding and form actions
logaretm 9524c53
feat: support filtering
logaretm 91f61ea
feat: render path state
logaretm 4ee0210
fix: make sure devtools is a dependency
logaretm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ export type FormField<TValue> = { | |
setTouched: (touched: boolean) => void; | ||
setErrors: (messages: Arrayable<string>) => void; | ||
displayError: () => string | undefined; | ||
form?: FormContext | null; | ||
}; | ||
|
||
export function useFormField<TValue = unknown>(opts?: Partial<FormFieldOptions<TValue>>): FormField<TValue> { | ||
|
@@ -200,7 +201,7 @@ export function useFormField<TValue = unknown>(opts?: Partial<FormFieldOptions<T | |
form.setFieldDisabled(path, disabled); | ||
}); | ||
|
||
return field; | ||
return { ...field, form }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to spread, just add the |
||
} | ||
|
||
function useFieldValidity(getPath: Getter<string | undefined>, isDisabled: Ref<boolean>, form?: FormContext | null) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "@formwerk/devtools", | ||
"version": "0.8.0", | ||
"description": "Formwerk's Vue devtools plugin", | ||
"author": "Abdelrahman Awad <[email protected]>", | ||
"license": "MIT", | ||
"funding": "https://github.com/sponsors/logaretm", | ||
"module": "dist/devtools.mjs", | ||
"unpkg": "dist/devtools.iife.js", | ||
"jsdelivr": "dist/devtools.iife.js", | ||
"main": "dist/index.mjs", | ||
"types": "dist/devtools.d.ts", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"import": "./dist/devtools.mjs", | ||
"require": "./dist/devtools.cjs", | ||
"types": "./dist/devtools.d.ts" | ||
}, | ||
"./dist/index.d.ts": "./dist/devtools.d.ts" | ||
}, | ||
"sideEffects": false, | ||
"keywords": [ | ||
"VueJS", | ||
"Vue", | ||
"validation", | ||
"validator", | ||
"inputs", | ||
"form" | ||
], | ||
"files": [ | ||
"dist/*.js", | ||
"dist/*.mjs", | ||
"dist/*.cjs", | ||
"dist/*.d.ts" | ||
], | ||
"dependencies": { | ||
"klona": "^2.0.6", | ||
"type-fest": "^4.34.1" | ||
}, | ||
"peerDependencies": { | ||
"@vue/devtools-api": "^7.5.2", | ||
"@vue/devtools-kit": "^7.5.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export function getPluginColors() { | ||
return { | ||
error: 0xbd4b4b, | ||
success: 0x06d77b, | ||
unknown: 0x54436b, | ||
white: 0xffffff, | ||
black: 0x000000, | ||
blue: 0x035397, | ||
purple: 0xb980f0, | ||
orange: 0xf5a962, | ||
gray: 0xbbbfca, | ||
}; | ||
} | ||
export function getInspectorId() { | ||
return 'formwerk-inspector'; | ||
} | ||
|
||
export function getRootFormId() { | ||
return '~none'; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename this to
resolvedForm
for clarity.