@zipify/wysiwyg 4.9.1 → 4.10.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/actions/lint-js/action.yaml +8 -3
- package/.lintstagedrc.mjs +32 -0
- package/.oxlintrc.json +185 -0
- package/dist/assets/wysiwyg-B8cHOAcD.css +908 -0
- package/dist/cli.js +35 -35
- package/dist/node.js +22 -22
- package/dist/types/Wysiwyg.vue.d.ts +38 -176
- package/dist/types/components/base/Button.vue.d.ts +2 -2
- package/dist/types/components/base/Modal.vue.d.ts +2 -2
- package/dist/types/components/base/ModalFloating.vue.d.ts +2 -2
- package/dist/types/components/base/NumberField.vue.d.ts +2 -2
- package/dist/types/entryLib.d.ts +2 -0
- package/dist/types/enums/Devices.d.ts +15 -6
- package/dist/types/enums/index.d.ts +9 -9
- package/dist/types/models/PageBlock.d.ts +4 -0
- package/dist/types/models/StylePreset.d.ts +27 -0
- package/dist/types/models/index.d.ts +3 -2
- package/dist/types/types/StylePresetVariableFactory.d.ts +8 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/wysiwyg.css +44 -76
- package/dist/wysiwyg.mjs +2077 -1331
- package/eslint.config.mjs +6 -0
- package/example/ExampleApp.vue +48 -78
- package/example/presets.ts +250 -0
- package/lib/Wysiwyg.vue +63 -118
- package/lib/cli/commands/Command.js +1 -2
- package/lib/components/base/Checkbox.vue +3 -0
- package/lib/components/base/Modal.vue +1 -1
- package/lib/components/base/colorPicker/ColorPicker.vue +11 -9
- package/lib/components/toolbar/Toolbar.vue +4 -4
- package/lib/components/toolbar/controls/__tests__/FontColorControl.test.js +2 -2
- package/lib/components/toolbar/controls/link/LinkControlHeader.vue +7 -2
- package/lib/components/toolbar/controls/link/__tests__/LinkControl.test.js +5 -5
- package/lib/components/toolbar/controls/link/__tests__/LinkControlHeader.test.js +4 -4
- package/lib/entryLib.ts +2 -0
- package/lib/enums/Devices.ts +17 -0
- package/lib/enums/index.ts +9 -0
- package/lib/extensions/FontStyle.js +3 -3
- package/lib/extensions/__tests__/StylePreset.test.js +5 -5
- package/lib/extensions/list/List.js +3 -3
- package/lib/extensions/list/__tests__/List.test.js +4 -4
- package/lib/models/PageBlock.ts +4 -0
- package/lib/models/StylePreset.ts +30 -0
- package/lib/models/index.ts +3 -2
- package/lib/services/JsonSerializer.js +0 -1
- package/lib/services/Storage.js +0 -1
- package/lib/services/__tests__/Storage.test.js +9 -4
- package/lib/services/normalizer/__tests__/HtmlNormalizer.test.js +25 -25
- package/lib/styles/variables.css +2 -33
- package/lib/types/StylePresetVariableFactory.ts +10 -0
- package/lib/types/index.ts +1 -0
- package/package.json +18 -28
- package/tsconfig.lint.json +7 -0
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -95
- package/.lintstagedrc +0 -12
- package/example/presets.js +0 -247
- package/lib/enums/Devices.js +0 -15
- package/lib/enums/index.js +0 -9
|
@@ -12,11 +12,16 @@ inputs:
|
|
|
12
12
|
runs:
|
|
13
13
|
using: "composite"
|
|
14
14
|
steps:
|
|
15
|
-
- run: npx
|
|
15
|
+
- run: npx oxlint --config .oxlintrc.json --tsconfig tsconfig.lint.json -f github ${{ inputs.files }}
|
|
16
16
|
shell: sh
|
|
17
17
|
|
|
18
|
-
-
|
|
18
|
+
- name: eslint
|
|
19
|
+
run: npx eslint --config eslint.config.mjs --output-file ./eslint_report.json --format json ${{ inputs.files }}
|
|
20
|
+
if: ${{ always() }}
|
|
21
|
+
shell: sh
|
|
22
|
+
|
|
23
|
+
- uses: ataylorme/eslint-annotate-action@v3
|
|
19
24
|
if: ${{ always() }}
|
|
20
25
|
with:
|
|
21
|
-
|
|
26
|
+
GITHUB_TOKEN: ${{ inputs.github-token }}
|
|
22
27
|
report-json: ./eslint_report.json
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ESLint } from 'eslint'
|
|
2
|
+
import eslintConfig from './eslint.config.mjs';
|
|
3
|
+
|
|
4
|
+
const eslint = new ESLint({
|
|
5
|
+
overrideConfigFile: true,
|
|
6
|
+
overrideConfig: eslintConfig
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
async function applyEslintIgnore(filenames) {
|
|
10
|
+
const isIgnored = await Promise.all(filenames.map((file) => eslint.isPathIgnored(file)))
|
|
11
|
+
const filteredFiles = filenames.filter((_, index) => !isIgnored[index])
|
|
12
|
+
return filteredFiles.join(' ')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
'*.{vue,css}': 'stylelint --allow-empty-input --fix --config stylelint.config.mjs',
|
|
17
|
+
|
|
18
|
+
'*.{vue,js,ts}': async (filenames) => {
|
|
19
|
+
const filtered = await applyEslintIgnore(filenames);
|
|
20
|
+
|
|
21
|
+
if (filtered.length === 0) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return [
|
|
26
|
+
`zipify-lint-js --oxlint-tsconfig ./tsconfig.lint.json --fix ${filtered}`,
|
|
27
|
+
`jest --passWithNoTests --findRelatedTests ${filtered}`
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
'*.svg': 'svgo --config ./config/svgo.js',
|
|
32
|
+
};
|
package/.oxlintrc.json
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"plugins": ["import"],
|
|
4
|
+
"env": {
|
|
5
|
+
"browser": true,
|
|
6
|
+
"node": true
|
|
7
|
+
},
|
|
8
|
+
"ignorePatterns": [
|
|
9
|
+
"dist/**"
|
|
10
|
+
],
|
|
11
|
+
"categories": {
|
|
12
|
+
"correctness": "error",
|
|
13
|
+
"suspicious": "error",
|
|
14
|
+
"restriction": "error"
|
|
15
|
+
},
|
|
16
|
+
"rules": {
|
|
17
|
+
"default-case": "off",
|
|
18
|
+
"default-param-last": "error",
|
|
19
|
+
"eqeqeq": ["warn", "smart"],
|
|
20
|
+
"guard-for-in": "off",
|
|
21
|
+
"import/default": "error",
|
|
22
|
+
"import/exports": "off",
|
|
23
|
+
"import/extensions": [
|
|
24
|
+
"error",
|
|
25
|
+
"never",
|
|
26
|
+
{
|
|
27
|
+
"scss": "always",
|
|
28
|
+
"html": "always",
|
|
29
|
+
"json": "always"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"import/first": "error",
|
|
33
|
+
"import/named": "off",
|
|
34
|
+
"import/namespace": "error",
|
|
35
|
+
"import/newline-after-import": "error",
|
|
36
|
+
"import/no-absolute-path": "error",
|
|
37
|
+
"import/no-cycle": "warn",
|
|
38
|
+
"import/no-default-export": "off",
|
|
39
|
+
"import/no-deprecated": "warn",
|
|
40
|
+
"import/no-dynamic-require": "off",
|
|
41
|
+
"import/no-namespace": "error",
|
|
42
|
+
"import/no-self-import": "error",
|
|
43
|
+
"import/no-useless-path-segments": "error",
|
|
44
|
+
"import/order": [
|
|
45
|
+
"error",
|
|
46
|
+
{
|
|
47
|
+
"pathGroups": [
|
|
48
|
+
{
|
|
49
|
+
"pattern": "@/**",
|
|
50
|
+
"group": "external"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"groups": [
|
|
54
|
+
"builtin",
|
|
55
|
+
"external",
|
|
56
|
+
"internal",
|
|
57
|
+
"parent",
|
|
58
|
+
"sibling"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"import/unambiguous": "off",
|
|
63
|
+
"max-params": ["error", 4],
|
|
64
|
+
"no-alert": "off",
|
|
65
|
+
"no-console": [
|
|
66
|
+
"error",
|
|
67
|
+
{
|
|
68
|
+
"allow": ["warn", "error", "assert"]
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"no-duplicate-imports": "error",
|
|
72
|
+
"no-empty-function": "off",
|
|
73
|
+
"no-eq-null": "off",
|
|
74
|
+
"no-extend-native": "error",
|
|
75
|
+
"no-new": "off",
|
|
76
|
+
"no-plusplus": "off",
|
|
77
|
+
"no-prototype-builtins": "off",
|
|
78
|
+
"no-restricted-imports": [
|
|
79
|
+
"error",
|
|
80
|
+
{
|
|
81
|
+
"patterns": [
|
|
82
|
+
{
|
|
83
|
+
"group": ["@vue/*", "vue"],
|
|
84
|
+
"importNames": ["defineProps", "defineEmits"],
|
|
85
|
+
"message": "'defineProps' and 'defineEmits' is compiler-time functions and should not be imported"
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"no-restricted-syntax": [
|
|
91
|
+
"error",
|
|
92
|
+
{
|
|
93
|
+
"selector": "PropertyDefinition[key.type=\"PrivateIdentifier\"]",
|
|
94
|
+
"message": "Native private fields breaks vue3 reactivity"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"selector": "MethodDefinition[key.type=\"PrivateIdentifier\"]",
|
|
98
|
+
"message": "Native private methods breaks vue3 reactivity"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"no-self-compare": "error",
|
|
102
|
+
"no-undefined": "off",
|
|
103
|
+
"no-unused-expressions": "off",
|
|
104
|
+
"no-unused-vars": [
|
|
105
|
+
"warn",
|
|
106
|
+
{
|
|
107
|
+
"vars": "local",
|
|
108
|
+
"args": "after-used"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"no-useless-concat": "error",
|
|
112
|
+
"no-void": "off"
|
|
113
|
+
},
|
|
114
|
+
"overrides": [
|
|
115
|
+
{
|
|
116
|
+
"files": ["*.ts", "*.vue"],
|
|
117
|
+
"plugins": ["typescript"],
|
|
118
|
+
"rules": {
|
|
119
|
+
"@typescript-eslint/ban-types": "off",
|
|
120
|
+
"@typescript-eslint/explicit-member-accessibility": [
|
|
121
|
+
"error",
|
|
122
|
+
{
|
|
123
|
+
"accessibility": "no-public"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
127
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
128
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
129
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
130
|
+
"import/extensions": [
|
|
131
|
+
"error",
|
|
132
|
+
"never",
|
|
133
|
+
{
|
|
134
|
+
"scss": "always",
|
|
135
|
+
"html": "always",
|
|
136
|
+
"json": "always",
|
|
137
|
+
"vue": "always"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"no-duplicate-imports": "off",
|
|
141
|
+
"no-undef": "off"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"files": ["*.ts"],
|
|
146
|
+
"rules": {
|
|
147
|
+
"@typescript-eslint/explicit-function-return-type": [
|
|
148
|
+
"error",
|
|
149
|
+
{
|
|
150
|
+
"allowExpressions": true,
|
|
151
|
+
"allowTypedFunctionExpressions": true
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"files": ["*.vue"],
|
|
158
|
+
"rules": {
|
|
159
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
160
|
+
"import/extensions": "off",
|
|
161
|
+
"import/no-cycle": "error"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"files": ["*.test.ts", "*.test.js"],
|
|
166
|
+
"plugins": ["jest"],
|
|
167
|
+
"rules": {
|
|
168
|
+
"jest/consistent-test-it": ["error", { "fn": "test", "withinDescribe": "test" }],
|
|
169
|
+
"jest/no-alias-methods": "off",
|
|
170
|
+
"jest/no-duplicate-hooks": "error",
|
|
171
|
+
"jest/no-test-return-statement": "error",
|
|
172
|
+
"jest/prefer-comparison-matcher": "error",
|
|
173
|
+
"jest/prefer-equality-matcher": "error",
|
|
174
|
+
"jest/prefer-hooks-in-order": "error",
|
|
175
|
+
"jest/prefer-hooks-on-top": "error",
|
|
176
|
+
"jest/prefer-spy-on": "error",
|
|
177
|
+
"jest/prefer-to-be": "error",
|
|
178
|
+
"jest/prefer-to-contain": "error",
|
|
179
|
+
"jest/prefer-to-have-length": "error",
|
|
180
|
+
"jest/require-hook": "error",
|
|
181
|
+
"jest/require-to-throw-message": "error"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|