@shijiu/jsview 2.3.151-test.0 → 3.0.0

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.
Files changed (78) hide show
  1. package/dom/bin/jsview-dom-browser-engine-core.min.js +1 -1
  2. package/dom/bin/jsview-dom-browser-engine-modules.min.js +1 -1
  3. package/dom/bin/{jsview-dom-browser-forge.1493.9a36.wasm → jsview-dom-browser-forge.1760.0e35.wasm} +0 -0
  4. package/dom/bin/jsview-dom-browser-forge.min.js +1 -1
  5. package/dom/bin/jsview-dom-browser-forge.worker.min.js +1 -1
  6. package/dom/bin/jsview-dom-browser.min.js +1 -1
  7. package/dom/bin/jsview-dom-native.min.js +1 -1
  8. package/dom/bin/jsview-engine-js-native.min.js +1 -1
  9. package/dom/target_core_revision.mjs +2 -2
  10. package/loader/jsv-core-api/jsview-core-api-glue.js +10 -1
  11. package/loader/jsv-core-api/wasm/core-api.js +87 -2
  12. package/loader/jsv-core-api/wasm/wasm-extension.js +5 -0
  13. package/loader/jsview-loader.js +7 -0
  14. package/loader/jsview-main.mjs +2 -1
  15. package/loader/jsview.config.default.js +4 -0
  16. package/package.json +7 -5
  17. package/patches/@vitejs+plugin-vue+4.0.0.patch +51 -0
  18. package/patches/@vitejs+plugin-vue+6.0.6.patch +54 -0
  19. package/patches/@vue+compiler-dom+3.2.45.patch +22 -0
  20. package/patches/@vue+compiler-dom+3.6.0-beta.10.patch +22 -0
  21. package/patches/@vue+compiler-sfc+3.2.45.patch +1986 -0
  22. package/patches/@vue+compiler-sfc+3.6.0-beta.10.patch +69 -0
  23. package/patches/@vue+runtime-core+3.2.45.patch +353 -0
  24. package/patches/@vue+runtime-core+3.6.0-beta.10.patch +198 -0
  25. package/patches/@vue+runtime-dom+3.2.45.patch +81 -0
  26. package/patches/@vue+runtime-dom+3.6.0-beta.10.patch +47 -0
  27. package/patches/postcss-js+5.1.0.patch +20 -0
  28. package/patches/vite+4.0.0.patch +117 -0
  29. package/patches/vite+8.0.9.patch +77 -0
  30. package/patches/vue-router+4.1.6.patch +17 -0
  31. package/patches/vue-router+5.0.6.patch +0 -0
  32. package/{patches/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js → thirdparty/@vue/compiler-sfc/jsview-css-to-js.cjs} +15 -10
  33. package/{patches/node_modules/@vue/compiler-sfc/dist/jsview-style-checker.js → thirdparty/@vue/compiler-sfc/jsview-style-checker.cjs} +6 -1
  34. package/{patches/node_modules/@vue/compiler-sfc/dist/jsview-style-formator.cjs.js → thirdparty/@vue/compiler-sfc/jsview-style-formator.cjs} +3 -0
  35. package/thirdparty/@vue/runtime-core/jsview-render-break.mjs +201 -0
  36. package/thirdparty/vite/jsview-vite-extension.mjs +336 -0
  37. package/tools/jsview-build-zip.mjs +7 -2
  38. package/tools/jsview-common.mjs +17 -4
  39. package/tools/{jsview-logger.js → jsview-logger.cjs} +1 -1
  40. package/tools/jsview-post-build.mjs +55 -0
  41. package/tools/jsview-post-install.mjs +98 -110
  42. package/tools/jsview-run-tool.mjs +3 -6
  43. package/tools/jsview-vue-devtools.mjs +1 -1
  44. package/loader/jsview-react-main.js +0 -37
  45. package/loader/jsview-react-script-loader.js +0 -134
  46. package/patches/node_modules/@vitejs/plugin-react/dist/index.cjs +0 -520
  47. package/patches/node_modules/@vitejs/plugin-react/package.json +0 -55
  48. package/patches/node_modules/@vitejs/plugin-vue/dist/index.mjs +0 -2756
  49. package/patches/node_modules/@vitejs/plugin-vue/package.json +0 -51
  50. package/patches/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js +0 -3152
  51. package/patches/node_modules/@vue/compiler-dom/package.json +0 -43
  52. package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -17730
  53. package/patches/node_modules/@vue/compiler-sfc/package.json +0 -59
  54. package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -8154
  55. package/patches/node_modules/@vue/runtime-core/package.json +0 -38
  56. package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +0 -1531
  57. package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1740
  58. package/patches/node_modules/@vue/runtime-dom/package.json +0 -42
  59. package/patches/node_modules/postcss-js/objectifier.js +0 -94
  60. package/patches/node_modules/postcss-js/package.json +0 -42
  61. package/patches/node_modules/react-dev-utils/WebpackDevServerUtils.js +0 -450
  62. package/patches/node_modules/react-dev-utils/package.json +0 -88
  63. package/patches/node_modules/react-dom/cjs/react-dom.development.js +0 -29868
  64. package/patches/node_modules/react-dom/cjs/react-dom.production.min.js +0 -323
  65. package/patches/node_modules/react-dom/package.json +0 -62
  66. package/patches/node_modules/react-scripts/config/paths.js +0 -179
  67. package/patches/node_modules/react-scripts/config/webpack.config.js +0 -858
  68. package/patches/node_modules/react-scripts/package.json +0 -108
  69. package/patches/node_modules/vite/dist/node/chunks/dep-ed9cb113.js +0 -63182
  70. package/patches/node_modules/vite/dist/node/constants.js +0 -125
  71. package/patches/node_modules/vite/dist/node/jsview-vite-extension.js +0 -245
  72. package/patches/node_modules/vite/package.json +0 -153
  73. package/patches/node_modules/vue-router/dist/vue-router.mjs +0 -3613
  74. package/patches/node_modules/vue-router/package.json +0 -114
  75. package/patches/node_modules/webpack-dev-server/client/utils/reloadApp.js +0 -76
  76. package/patches/node_modules/webpack-dev-server/client/utils/sendMessage.js +0 -21
  77. package/patches/node_modules/webpack-dev-server/package.json +0 -141
  78. /package/patches/{node_modules/@originjs/vite-plugin-federation/1.3.4/@originjs+vite-plugin-federation+1.3.4.patch → @originjs+vite-plugin-federation+1.3.4.patch} +0 -0
@@ -0,0 +1,1986 @@
1
+ diff --git a/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js b/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js
2
+ index 2e1517a..89a91a2 100644
3
+ --- a/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js
4
+ +++ b/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js
5
+ @@ -16,6 +16,9 @@ var fs = require('fs');
6
+ var util$2 = require('util');
7
+ var reactivityTransform = require('@vue/reactivity-transform');
8
+ var _postcss = require('postcss');
9
+ +// JsView Added >>>
10
+ +var jsvCssToJs = require("./jsview-css-to-js");
11
+ +// JsView Added <<<
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
14
+
15
+ @@ -3223,7 +3226,11 @@ function doCompileTemplate({ filename, id, scoped, slotted, inMap, source, ssr =
16
+ let { code, ast, preamble, map } = compiler.compile(source, {
17
+ mode: 'module',
18
+ prefixIdentifiers: true,
19
+ - hoistStatic: true,
20
+ +// JsView Added >>>
21
+ +// 解决xxx问题。
22
+ +// hoistStatic: true,
23
+ + hoistStatic: false,
24
+ +// JsView Added <<<
25
+ cacheHandlers: true,
26
+ ssrCssVars: ssr && ssrCssVars && ssrCssVars.length
27
+ ? genCssVarsFromList(ssrCssVars, shortId, isProd, true)
28
+ @@ -3512,6 +3519,10 @@ function compileScript(sfc, options) {
29
+ content += genNormalScriptCssVarsCode(cssVars, bindings, scopeId, isProd);
30
+ content += `\nexport default ${DEFAULT_VAR}`;
31
+ }
32
+ +// JsView Added >>>
33
+ +// 在标准写法下,将Css转换为Js, 并注入到Js文件。
34
+ + content += jsvCssToJs.compileCssToJs(sfc, options);
35
+ +// JsView Added <<<
36
+ return {
37
+ ...script,
38
+ content,
39
+ @@ -4593,6 +4604,10 @@ function compileScript(sfc, options) {
40
+ .join(', ')} } from 'vue'\n`);
41
+ }
42
+ s.trim();
43
+ +// JsView Added >>>
44
+ +// 在setup写法下,将Css转换为Js, 并注入到Js文件。
45
+ + s.append(jsvCssToJs.compileCssToJs(sfc, options));
46
+ +// JsView Added <<<
47
+ return {
48
+ ...scriptSetup,
49
+ bindings: bindingMetadata,
50
+ @@ -5272,6 +5287,10 @@ function parse(source, { sourceMap = true, filename = DEFAULT_FILENAME, sourceRo
51
+ // check if the SFC uses :slotted
52
+ const slottedRE = /(?:::v-|:)slotted\(/;
53
+ descriptor.slotted = descriptor.styles.some(s => s.scoped && slottedRE.test(s.content));
54
+ +// JsView Added >>>
55
+ +// 如果不存在<script>标签,则手动添加一个用于处理Css转为Js。
56
+ + jsvCssToJs.ensureSfcDescriptor(descriptor);
57
+ +// JsView Added <<<
58
+ const result = {
59
+ descriptor,
60
+ errors
61
+ diff --git a/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js b/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js
62
+ new file mode 100644
63
+ index 0000000..295b919
64
+ --- /dev/null
65
+ +++ b/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js
66
+ @@ -0,0 +1,487 @@
67
+ +/*
68
+ + * QCode Added
69
+ + */
70
+ +'use strict';
71
+ +
72
+ +Object.defineProperty(exports, '__esModule', { value: true });
73
+ +
74
+ +const crypto = require('crypto');
75
+ +const fs = require('fs');
76
+ +const path = require('path');
77
+ +const postCss = require('postcss');
78
+ +const postCssJs = require('postcss-js');
79
+ +const styleChecker = require('./jsview-style-checker');
80
+ +const { Logger } = require('@shijiu/jsview/tools/jsview-logger.cjs');
81
+ +
82
+ +const compilerSfc = require('./compiler-sfc.cjs');
83
+ +const processorLangList = [
84
+ + 'less',
85
+ + 'sass',
86
+ + 'scss',
87
+ + 'styl',
88
+ + 'stylus',
89
+ +];
90
+ +
91
+ +const cachedCssStyles = {};
92
+ +
93
+ +function ensureSfcDescriptor(descriptor) {
94
+ + try {
95
+ + ensureSfcDescriptorImpl(descriptor)
96
+ + } catch (exception) {
97
+ + Logger.ErrorAndThrow(Logger.GetFileTag(descriptor.filename), 'Failed to call ensureSfcDescriptor()!');
98
+ + }
99
+ +}
100
+ +
101
+ +function compileCssToJs(sfc, options) {
102
+ + try {
103
+ + // 必须在此处parse css,否则npm run build时进入不到js代码中。
104
+ + // const styleJsFilePath = getStyleJsFilePath(sfc.filename);
105
+ + // return `\nimport '${styleJsFilePath}';`
106
+ +
107
+ + const compiledJsContent = compileCssToJsImpl(sfc, options)
108
+ + return compiledJsContent;
109
+ + } catch (exception) {
110
+ + Logger.ErrorAndExit(Logger.GetFileTag(sfc.filename), 'Failed to call compileCssToJs()!', exception);
111
+ + }
112
+ +}
113
+ +
114
+ +function compileCssToJsImpl(sfc, options) {
115
+ + let cachedStyleImports = [];
116
+ + let cachedStyleSheets = {};
117
+ + for (const style of sfc.styles) {
118
+ + if(!!style.module) {
119
+ + let errMsg = 'style module is not released by Vue3!\n';
120
+ + errMsg += style;
121
+ + Logger.ErrorAndThrow(Logger.GetFileTag(sfc.filename), errMsg + ' errors =', errors);
122
+ + }
123
+ +
124
+ + const compileStyleOptions = {
125
+ + filename: sfc.filename,
126
+ + id: `data-v-${options.id}`,
127
+ + // map: null,
128
+ + trim: true,
129
+ + isProd: options.isProd,
130
+ +
131
+ + source: style.content,
132
+ + scoped: style.scoped,
133
+ + modules: style.module,
134
+ +
135
+ + preprocessLang: style.attrs.lang,
136
+ + };
137
+ +
138
+ + if(!!style.attrs.src) { // 处理<style [scoped] src='xxx'>
139
+ + const baseDir = path.dirname(sfc.filename);
140
+ + const cssSrcPath = path.resolve(baseDir, style.attrs.src);
141
+ + compileStyleOptions.source = fs.readFileSync(cssSrcPath, 'utf8');
142
+ + }
143
+ +
144
+ + const { rawResult, errors } = compilerSfc.compileStyle(compileStyleOptions)
145
+ + if(errors.length) {
146
+ + const errMsg = 'Failed to compile style when convert css to js!';
147
+ + Logger.ErrorAndThrow(Logger.GetFileTag(sfc.filename), errMsg + ' errors =', errors);
148
+ + }
149
+ +
150
+ + const {styleImports, styleSheets } = compileAndSaveImportedNode(rawResult.result.root.nodes);
151
+ + cachedStyleImports = [...cachedStyleImports, ...styleImports];
152
+ + cachedStyleSheets = { ...cachedStyleSheets, ...styleSheets };
153
+ + }
154
+ +
155
+ + const styleJsContents = serializeStyleJsFile(cachedStyleImports, cachedStyleSheets);
156
+ +
157
+ + // Logger.Debug(Logger.GetFileTag(sfc.filename), 'styleJsContents=', styleJsContents);
158
+ +
159
+ + return styleJsContents;
160
+ +}
161
+ +
162
+ +function ensureSfcDescriptorImpl(descriptor) {
163
+ + // 如果css-style不存在,不做任何事
164
+ + if(descriptor.styles.length <= 0) {
165
+ + return;
166
+ + }
167
+ +
168
+ + // 为了将css-style植入到script中,script或scriptSetup必须存在一个
169
+ + if(!!descriptor.script
170
+ + || !!descriptor.scriptSetup) {
171
+ + return;
172
+ + }
173
+ +
174
+ + // 为了触发compiler-sfc.cjs.compileScript()
175
+ + // 如果script和scriptSetup都不存在,就做一个空的
176
+ + // Logger.Debug('insert a empty script.');
177
+ + descriptor.script = {
178
+ + type: 'script',
179
+ + content: 'export default {}\n',
180
+ + loc: {
181
+ + source: '',
182
+ + start: { column: 0, line: 0, offset: 0 },
183
+ + end: { column: 0, line: 0, offset: 0}
184
+ + },
185
+ + attrs: {},
186
+ + map: {
187
+ + version: 3,
188
+ + sources: [],
189
+ + names: [],
190
+ + mappings: '',
191
+ + // file: null,
192
+ + sourceRoot: '',
193
+ + sourcesContent: []
194
+ + }
195
+ + };
196
+ +}
197
+ +
198
+ +function checkSelectors(node, styleFilePath, styleSelectors) {
199
+ + for(let cachedFilePath in cachedCssStyles) {
200
+ + if(cachedFilePath == styleFilePath) {
201
+ + continue;
202
+ + }
203
+ +
204
+ + const cachedSelectors = cachedCssStyles[cachedFilePath];
205
+ + for(let selector of cachedSelectors) {
206
+ + if(styleSelectors.has(selector)) { // 发现重复的selector
207
+ + if (selector.includes['['] && selector.includes[']']) { // scoped style
208
+ + let errMsg = 'Multi defined CSS selector "' + selector + '" from ' + node.source.input.file + '.\n';
209
+ + errMsg += 'It has been defined in ' + cachedFilePath + '.\n';
210
+ + Logger.Warn(Logger.GetFileTag(node.source.input.file), errMsg);
211
+ + }
212
+ + return false;
213
+ + }
214
+ + }
215
+ + }
216
+ +
217
+ + // 添加到缓存
218
+ + let cachedSelectors = cachedCssStyles[styleFilePath];
219
+ + if(!cachedSelectors) {
220
+ + cachedSelectors = new Set()
221
+ + }
222
+ + cachedSelectors = new Set([...cachedSelectors, ...styleSelectors]);
223
+ + cachedCssStyles[styleFilePath] = cachedSelectors;
224
+ +
225
+ + return true;
226
+ +}
227
+ +
228
+ +function check(expr, node, source, errMsg) {
229
+ + if(!expr) {
230
+ + errMsg += ('\n source is: \n' + source);
231
+ + Logger.ErrorAndThrow(Logger.GetFileTag(node.source.input.file), errMsg);
232
+ + }
233
+ +}
234
+ +
235
+ +function compileAndSaveImportedNode(styleNodes) {
236
+ + let styleImports = [];
237
+ + let styleSheets = {};
238
+ +
239
+ + for(const node of styleNodes) {
240
+ + if (node.type === 'comment'
241
+ + || node.name === '-webkit-keyframes'
242
+ + || node.name === 'charset') {
243
+ + // DO NOTHING
244
+ + } else if(node.name === 'import') {
245
+ + const importContent = compileImportNodeRecursive(node);
246
+ + if (importContent && styleImports.includes(importContent) == false) {
247
+ + styleImports.push(importContent);
248
+ + }
249
+ + } else if(node.name === 'keyframes') {
250
+ + const styleFilePath = node.source.input.file;
251
+ + const styleSelectors = new Set([node.params]);
252
+ + const checked = checkSelectors(node, styleFilePath, styleSelectors); // 检测selector是否已经处理过
253
+ + if (checked == false) {
254
+ + Logger.Warn(Logger.GetFileTag(node.source.input.file), 'Multi defined CSS keyframes "' + node.params + '".\n');
255
+ + }
256
+ +
257
+ + const subStyleSheets = compileKeyframesNode(node);
258
+ + for (const [scopedId, styleRules] of Object.entries(subStyleSheets)) {
259
+ + styleSheets[scopedId] = Object.assign(styleSheets[scopedId] ?? {}, styleRules);
260
+ + }
261
+ + } else if(!!node.selector) {
262
+ + const styleFilePath = node.source.input.file;
263
+ + const styleSelectors = new Set([node.selector]);
264
+ + const checked = checkSelectors(node, styleFilePath, styleSelectors); // 检测selector是否已经处理过
265
+ + if (checked == false) {
266
+ + Logger.Warn(Logger.GetFileTag(node.source.input.file), 'Multi defined CSS selector "' + node.selector + '".\n');
267
+ + }
268
+ +
269
+ + const subStyleSheets = compileSelectorNode(node);
270
+ + for (const [scopedId, styleRules] of Object.entries(subStyleSheets)) {
271
+ + const mergedStyleRules = styleSheets[scopedId] ?? {};
272
+ + for (const [selector, declarations] of Object.entries(styleRules)) {
273
+ + let mergedDeclarations = mergedStyleRules[selector] ?? '{}';
274
+ + mergedDeclarations = Object.assign(JSON.parse(mergedDeclarations), JSON.parse(declarations));
275
+ + mergedStyleRules[selector] = JSON.stringify(mergedDeclarations);
276
+ + }
277
+ + styleSheets[scopedId] = mergedStyleRules;
278
+ + }
279
+ + styleSelectors.add(node.selector);
280
+ + } else if (node.name === '-moz-keyframes'
281
+ + || node.name === '-o-keyframes'
282
+ + || node.name === '-webkit-keyframes') {
283
+ + // Stylus 添加的keyframes,忽略,只处理@keyframes
284
+ + } else {
285
+ + Logger.Info(Logger.GetFileTag(node.source.input.file), 'Unsupported css node: ', node);
286
+ + check(false, node, node.source.input.css, 'Unsupported css node from import css file.');
287
+ + }
288
+ + }
289
+ +
290
+ + // Logger.Debug(Logger.GetFileTag(node.source.input.file), 'jsview-css-to-js.compileAndSaveImportedNode() styleSheets=', styleImports, styleSheets);
291
+ + return {
292
+ + styleImports,
293
+ + styleSheets,
294
+ + }
295
+ +}
296
+ +
297
+ +function serializeStyleJsFile(styleImports, styleSheets) {
298
+ + let styleJsContent = '\n';
299
+ +
300
+ + if (styleImports.length > 0) {
301
+ + const styleImportsContent = styleImports.join('\n');
302
+ + styleJsContent += styleImportsContent;
303
+ + }
304
+ +
305
+ + if (Object.keys(styleSheets).length > 0) {
306
+ + const styleSheetsContent = JSON.stringify(styleSheets);
307
+ + styleJsContent += '\nconst styleSheetsContent = ';
308
+ + styleJsContent += styleSheetsContent;
309
+ + styleJsContent += ';\nwindow.JsvCode.Dom.DeclareStyleSheets(styleSheetsContent);';
310
+ + }
311
+ +
312
+ + return styleJsContent;
313
+ +}
314
+ +
315
+ +function getStyleJsCacheDir() {
316
+ + const nodeModulesDir = path.resolve(process.cwd(), 'node_modules');
317
+ + const cacheDir = path.resolve(nodeModulesDir, '.vite', 'jsview', 'css-to-js'); // 不能放在.vite文件夹,否则有网络缓存,文件改变后不更新
318
+ + if (!fs.existsSync(cacheDir)) {
319
+ + fs.mkdirSync(cacheDir, { recursive: true });
320
+ + }
321
+ +
322
+ + return cacheDir;
323
+ +}
324
+ +
325
+ +function getStyleJsFilePath(styleFilePath) {
326
+ + // 保存到js文件并import到script中
327
+ + const cacheDir = getStyleJsCacheDir()
328
+ +
329
+ + const styleFilePathHash = crypto.createHash('md5').update(styleFilePath).digest('hex').substring(0, 8);
330
+ + const styleJsFileName = path.basename(styleFilePath) + '.' + styleFilePathHash + '.js';
331
+ + const styleJsFilePath = path.join(cacheDir, styleJsFileName);
332
+ + if (!fs.existsSync(styleJsFilePath)) {
333
+ + fs.closeSync(fs.openSync(styleJsFilePath, 'w'));
334
+ + }
335
+ +
336
+ + return styleJsFilePath;
337
+ +}
338
+ +
339
+ +function getStringOffset(node, source, line, column) {
340
+ + check(!isNaN(line), node, source, 'Failed to get string offset, line is NaN.');
341
+ + check(!isNaN(column), node, source, 'Failed to get string offset, column is NaN.');
342
+ +
343
+ + line -= 1;
344
+ + column -= 1;
345
+ +
346
+ + var offset = 0;
347
+ + for (var idx = 0; idx < line; idx++) {
348
+ + offset = source.indexOf('\n', offset + 1);
349
+ + check(offset >= 0, node, source, 'Failed to get string offset, line=' + line + ', column=' + column);
350
+ + }
351
+ + offset += column;
352
+ +
353
+ + return offset;
354
+ +}
355
+ +
356
+ +function compileImportNodeRecursive(node, parsedImports = []) {
357
+ + const name = node.name;
358
+ + check(name === 'import', node, node.source.input.css, '@import name is not found!');
359
+ +
360
+ + let cssFilePath = node.params.replaceAll('"', '');
361
+ + cssFilePath = cssFilePath.replaceAll("'", '');
362
+ + const baseDir = path.dirname(node.source.input.file);
363
+ + const cssFileFullPath = path.resolve(baseDir, cssFilePath);
364
+ + const styleJsFilePath = getStyleJsFilePath(cssFileFullPath);
365
+ +
366
+ + // 解死循环
367
+ + if (parsedImports.includes(cssFileFullPath)) {
368
+ + Logger.Info(Logger.GetFileTag(node.source.input.file), 'Ignore to parse file in dead loop: ' + cssFileFullPath);
369
+ + return null;
370
+ + }
371
+ + parsedImports.push(cssFileFullPath);
372
+ +
373
+ + try {
374
+ + const content = fs.readFileSync(cssFileFullPath, 'utf8');;
375
+ + const options = {
376
+ + from: cssFileFullPath
377
+ + };
378
+ + const parsedCss = postCss([]).process(content, options);
379
+ +
380
+ + const styleNodes = parsedCss.result.root.nodes;
381
+ + const styleImportNodes = [];
382
+ + const importNodeIndexs = [];
383
+ + for (let idx = 0; idx < styleNodes.length; idx++) {
384
+ + const node = styleNodes[idx];
385
+ + if (node.name !== 'import') {
386
+ + continue;
387
+ + }
388
+ +
389
+ + importNodeIndexs.push(idx);
390
+ + }
391
+ + for (const idx of importNodeIndexs) {
392
+ + const node = styleNodes[idx];
393
+ + styleImportNodes.push(node);
394
+ + styleNodes.splice(idx, 1);
395
+ + }
396
+ +
397
+ + const styleImports = [];
398
+ + for (const node of styleImportNodes) {
399
+ + const importContent = compileImportNodeRecursive(node, parsedImports);
400
+ + if (styleImports.includes(importContent) == true) {
401
+ + continue;
402
+ + }
403
+ +
404
+ + styleImports.push(importContent);
405
+ + }
406
+ +
407
+ + const { _, styleSheets } = compileAndSaveImportedNode(styleNodes);
408
+ + const styleJsContents = serializeStyleJsFile(styleImports, styleSheets);
409
+ +
410
+ + fs.writeFileSync(styleJsFilePath, styleJsContents, 'utf8');;
411
+ + } catch (e) {
412
+ + Logger.ErrorAndThrow(Logger.GetFileTag(node.source.input.file), 'Failed to compile css import node.', e);
413
+ + }
414
+ +
415
+ + let styleJsFileRelativePath = path.relative(baseDir, styleJsFilePath);
416
+ + styleJsFileRelativePath = styleJsFileRelativePath.replaceAll('\\', '/');
417
+ + const styleImportContent = `\nimport '${styleJsFileRelativePath}';`;
418
+ +
419
+ + // Logger.Debug(Logger.GetFileTag(node.source.input.file), 'return ', styleImportContent);
420
+ + return styleImportContent;
421
+ +}
422
+ +
423
+ +function compileKeyframesNode(node) {
424
+ + const name = node.name;
425
+ + check(name, node, node.source.input.css, 'name is not found!');
426
+ +
427
+ + check(name === 'keyframes', node, node.source.input.css, '@keyframes name is not found!');
428
+ +
429
+ + // let startOffset = node.source.start.offset;
430
+ + // let endOffset = node.source.end.offset;
431
+ + // if (typeof (startOffset) == 'undefined') {
432
+ + // startOffset = getStringOffset(node.source.input.css, node.source.start.line, node.source.start.column);
433
+ + // }
434
+ + // if (typeof (endOffset) == 'undefined') {
435
+ + // endOffset = getStringOffset(node.source.input.css, node.source.end.line, node.source.end.column);
436
+ + // }
437
+ + // const content = node.source.input.css.slice(startOffset, endOffset + 1);
438
+ + // Logger.Debug(Logger.GetFileTag(node.source.input.file), startOffset, endOffset, content);
439
+ +
440
+ + let content = '{';
441
+ + for (const ident of node.nodes) {
442
+ + if (ident.type === 'comment') {
443
+ + continue;
444
+ + }
445
+ + content += ident.selector;
446
+ + content += '{';
447
+ + for (const declaration of ident.nodes) {
448
+ + content += declaration.prop + ':' + declaration.value + ';';
449
+ + }
450
+ + content += '}';
451
+ + }
452
+ + content += '}';
453
+ + content = content.replaceAll('\\', ''); // 去掉var()里面的 \\
454
+ +
455
+ + const kfName = node.params;
456
+ + let kfValue = '@keyframes ' + kfName + ' ' + content;
457
+ + kfValue = styleChecker.GetFormattedKeyframe(node.source.input.file, kfName, kfValue);
458
+ +
459
+ + const scopedId = '0'; // CSS规范中,keyframes没有继承, 放在glabol中
460
+ + const kfRule = { [kfName]: kfValue };
461
+ +
462
+ + const styleSheets = { [scopedId]: kfRule };
463
+ +
464
+ + // Logger.Debug(Logger.GetFileTag(node.source.input.file), 'return ', styleSheets);
465
+ + return styleSheets;
466
+ +}
467
+ +
468
+ +function compileSelectorNode(node) {
469
+ + const selector = node.selector;
470
+ + check(selector, node, node.source.input.css, 'Selector is not found!');
471
+ +
472
+ + let errMsg = 'Only class selector is supported!\n';
473
+ + errMsg += 'Please use css like `.classname { property: value; }`';
474
+ + check(selector.startsWith('.'), node, node.source.input.css, errMsg);
475
+ +
476
+ + const declarations = postCssJs.objectify(node);
477
+ + const styleSheets = parsePostCssJs(node, selector, declarations);
478
+ +
479
+ + // Logger.Debug(Logger.GetFileTag(node.source.input.file), 'return ', styleSheets);
480
+ + return styleSheets;
481
+ +}
482
+ +
483
+ +function parsePostCssJs(node, selector, declarations) {
484
+ + const styleSheets = { };
485
+ +
486
+ + // 对 .a, .b {} 的支持
487
+ + const selectorArray = selector.split(',');
488
+ + for (let selector of selectorArray) {
489
+ + selector = selector.trim();
490
+ +
491
+ + let scopedId = selector.substring(selector.indexOf('[') + 1, selector.lastIndexOf(']'));
492
+ + if (scopedId) {
493
+ + selector = selector.substring(0, selector.indexOf('['));
494
+ + scopedId = scopedId.replace('data-v-', '');
495
+ + } else {
496
+ + scopedId = '0';
497
+ + }
498
+ +
499
+ + const styleRules = parseUnscopedStyleSheets(node, selector, declarations, scopedId);
500
+ +
501
+ + let mergedStyleRules = styleSheets[scopedId] ?? {};
502
+ + mergedStyleRules = Object.assign(mergedStyleRules, styleRules);
503
+ + styleSheets[scopedId] = mergedStyleRules;
504
+ + }
505
+ +
506
+ + return styleSheets;
507
+ +}
508
+ +
509
+ +function parseUnscopedStyleSheets(node, selector, declarations, scopedId) {
510
+ + let styleRules = {};
511
+ +
512
+ + for (let [name, value] of Object.entries(declarations)) {
513
+ + if (name == 'objectFit' || name == 'overflow') {
514
+ + // 因为<style>标签中添加objectFit和overflow的操作滞后于Element的ClipView创建,
515
+ + // 所以 class 不支持'objectFit' 和 styleName == 'overflow'
516
+ + const errMsg = "Unimplemented style name: " + name + ", please set the " + name + " attribute directly in the element's style.";
517
+ + Logger.Warn(Logger.GetFileTag(node.source.input.file), errMsg);
518
+ + }
519
+ + if (value instanceof Array) { // 同一个name定义了多次
520
+ + Logger.Warn(Logger.GetFileTag(node.source.input.file), 'Multi defined CSS name "' + name + '" from ' + selector + '.\n');
521
+ + value = value[value.length - 1];
522
+ + }
523
+ +
524
+ + // 处理var变量中如果存在'a.b'的写法,被翻译成'a\.b'的问题。
525
+ + if (typeof (value) == 'string' && value.startsWith('var(--')) {
526
+ + value = value.replaceAll('\\', '');
527
+ + }
528
+ +
529
+ + if (name.startsWith('@keyframes')) { // keyframes解嵌套处理
530
+ + check(false, node, node.source.input.css, 'Nested keyframes is not supported!');
531
+ + delete declarations[name];
532
+ + continue;
533
+ + } else if (value instanceof Object) { // css class解嵌套处理
534
+ + const unscopedName = name.replace('[data-v-' + scopedId + ']', '');
535
+ + const nestedStyleSheets = parseUnscopedStyleSheets(node, selector + ' ' + unscopedName, value, scopedId);
536
+ + styleRules = Object.assign(styleRules, nestedStyleSheets);
537
+ + delete declarations[name];
538
+ + continue;
539
+ + }
540
+ +
541
+ + const formattedValue = styleChecker.GetFormattedValue(node.source.input.file, name, value);
542
+ + declarations[name] = formattedValue;
543
+ + }
544
+ +
545
+ + styleRules[selector] = JSON.stringify(declarations);
546
+ +
547
+ + // Logger.Debug(Logger.GetFileTag(node.source.input.file), 'return ', styleRules);
548
+ + return styleRules;
549
+ +}
550
+ +
551
+ +exports.ensureSfcDescriptor = ensureSfcDescriptor;
552
+ +exports.compileCssToJs = compileCssToJs;
553
+ +// exports.compileAndSaveImportedNode = compileAndSaveImportedNode;
554
+ diff --git a/node_modules/@vue/compiler-sfc/dist/jsview-style-checker.js b/node_modules/@vue/compiler-sfc/dist/jsview-style-checker.js
555
+ new file mode 100644
556
+ index 0000000..848b451
557
+ --- /dev/null
558
+ +++ b/node_modules/@vue/compiler-sfc/dist/jsview-style-checker.js
559
+ @@ -0,0 +1,209 @@
560
+ +const {
561
+ + StyleFormator,
562
+ + StyleName,
563
+ + StyleValue,
564
+ + StyleVariable
565
+ +} = require("./jsview-style-formator.cjs");
566
+ +const { Logger } = require('@shijiu/jsview/tools/jsview-logger.cjs');
567
+ +
568
+ +class StyleChecker {
569
+ + static GetFormattedValue(fileName, propName, propValue) {
570
+ + propValue = new StyleValue(propValue);
571
+ + if (StyleVariable.IsVariable(propValue)) {
572
+ + return propValue.get();
573
+ + }
574
+ +
575
+ + let formattedValue = propValue.get();
576
+ + switch (propName) {
577
+ + case StyleName.Layout.Height:
578
+ + case StyleName.Layout.Left:
579
+ + case StyleName.Layout.Top:
580
+ + case StyleName.Layout.Width:
581
+ + formattedValue = StyleChecker.#GetLayoutValue(fileName, propName, propValue);
582
+ + break;
583
+ + case StyleName.Background.BackgroundColor:
584
+ + case StyleName.Background.BackgroundImage:
585
+ + case StyleName.Background.BorderRadius:
586
+ + formattedValue = StyleChecker.#GetBackgroundValue(fileName, propName, propValue);
587
+ + break;
588
+ + case StyleName.Effect.BackfaceVisibility:
589
+ + case StyleName.Effect.BorderImage:
590
+ + case StyleName.Effect.BorderImageWidth:
591
+ + case StyleName.Effect.BorderImageOutset:
592
+ + case StyleName.Effect.ClipPath:
593
+ + case StyleName.Effect.Display:
594
+ + case StyleName.Effect.ObjectFit:
595
+ + // case StyleName.Effect.Opacity:
596
+ + case StyleName.Effect.Overflow:
597
+ + case StyleName.Effect.Perspective:
598
+ + case StyleName.Effect.PerspectiveOrigin:
599
+ + case StyleName.Effect.Transform:
600
+ + case StyleName.Effect.TransformOrigin:
601
+ + case StyleName.Effect.TransformStyle:
602
+ + case StyleName.Effect.Visibility:
603
+ + case StyleName.Effect.ZIndex:
604
+ + formattedValue = StyleChecker.#GetEffectValue(fileName, propName, propValue);
605
+ + break;
606
+ + case StyleName.Text.Color:
607
+ + case StyleName.Text.FontFamily:
608
+ + case StyleName.Text.FontSize:
609
+ + case StyleName.Text.FontStyle:
610
+ + case StyleName.Text.FontWeight:
611
+ + case StyleName.Text.LineHeight:
612
+ + case StyleName.Text.TextAlign:
613
+ + case StyleName.Text.TextShadow:
614
+ + case StyleName.Text.TextOverflow:
615
+ + case StyleName.Text.WebkitTextStroke:
616
+ + case StyleName.Text.WhiteSpace:
617
+ + case StyleName.Text.WordWrap:
618
+ + formattedValue = StyleChecker.#GetTextValue(fileName, propName, propValue);
619
+ + break;
620
+ + case StyleName.Motion.Animation:
621
+ + case StyleName.Motion.Transition:
622
+ + formattedValue = StyleChecker.#GetMotionValue(fileName, propName, propValue);
623
+ + break;
624
+ + default:
625
+ + // 返回未处理的值
626
+ + console.warn("JsView Warn: Unimplemented style property [" + propName + "]");
627
+ + break;
628
+ + }
629
+ +
630
+ + return formattedValue;
631
+ + }
632
+ +
633
+ + static GetFormattedKeyframe(fileName, propName, propValue) {
634
+ + let removedPxSuffix = false;
635
+ +
636
+ + // 去掉translate3d中的px单位
637
+ + const valueArray = propValue.split('translate3d');
638
+ + for (let idx = 1; idx < valueArray.length; idx++) {
639
+ + let useFormated = false;
640
+ + let translate3dValue = valueArray[idx].replace(/\).*/, ''); // 只保留value
641
+ + translate3dValue = translate3dValue.replace(/.*\(/, ''); // 只保留value
642
+ + const translate3dCoord = translate3dValue.split(',');
643
+ + for (let coordIdx = 0; coordIdx < translate3dCoord.length; coordIdx++) {
644
+ + const coordValue = translate3dCoord[coordIdx].trim();
645
+ + if (coordValue.includes('px')) {
646
+ + translate3dCoord[coordIdx] = coordValue.replace('px', '');
647
+ + useFormated = true;
648
+ + }
649
+ + }
650
+ +
651
+ + if (useFormated) { // 替换成去掉px的值
652
+ + translate3dValue = translate3dCoord.join(',');
653
+ + valueArray[idx] = valueArray[idx].replace(/\(.*?\)/, '(' + translate3dValue + ')');
654
+ + removedPxSuffix = true;
655
+ + }
656
+ + }
657
+ +
658
+ + if (removedPxSuffix) {
659
+ + const msg = ` Auto optimize style keyframes ${propName},`
660
+ + + ` remove unnecessary 'px' suffix.`;
661
+ + Logger.Info(Logger.GetFileTag(fileName), msg);
662
+ + }
663
+ + const value = valueArray.join('translate3d');
664
+ +
665
+ + return value;
666
+ + }
667
+ +
668
+ + static #GetLayoutValue(fileName, propName, propValue) {
669
+ + const formattedValue = StyleChecker.#ConvertToInt32(fileName, propName, propValue);
670
+ +
671
+ + return formattedValue;
672
+ + }
673
+ +
674
+ + static #GetBackgroundValue(fileName, propName, propValue) {
675
+ + let formattedValue = null;
676
+ + switch (propName) {
677
+ + case StyleName.Background.BackgroundColor:
678
+ + formattedValue = StyleChecker.#ConvertToColor(fileName, propName, propValue);
679
+ + break;
680
+ + case StyleName.Background.BorderRadius:
681
+ + formattedValue = StyleFormator.ConvertToString(propName, propValue);
682
+ + if (formattedValue.includes?.('px')) {
683
+ + formattedValue = formattedValue.replace?.('px', ''); // 去掉px
684
+ +
685
+ + const msg = ` Auto optimize style ${propName},`
686
+ + + ` remove unnecessary 'px'.`;
687
+ + Logger.Info(Logger.GetFileTag(fileName), msg);
688
+ + }
689
+ + break;
690
+ + default:
691
+ + formattedValue = StyleFormator.ConvertToString(propName, propValue);
692
+ + break;
693
+ + }
694
+ +
695
+ + return formattedValue;
696
+ + }
697
+ +
698
+ + static #GetEffectValue(fileName, propName, propValue) {
699
+ + let formattedValue = null;
700
+ + switch (propName) {
701
+ + // case StyleName.Effect.Opacity:
702
+ + // formattedValue = StyleFormator.ConvertToFloat(propName, propValue);
703
+ + // break;
704
+ + case StyleName.Effect.ZIndex:
705
+ + formattedValue = StyleFormator.ConvertToInt32(propName, propValue);
706
+ + break;
707
+ + default:
708
+ + formattedValue = StyleFormator.ConvertToString(propName, propValue);
709
+ + break;
710
+ + }
711
+ +
712
+ + return formattedValue;
713
+ + }
714
+ +
715
+ + static #GetTextValue(fileName, propName, propValue) {
716
+ + let formattedValue = null;
717
+ + switch (propName) {
718
+ + case StyleName.Text.Color:
719
+ + formattedValue = StyleChecker.#ConvertToColor(fileName, propName, propValue);
720
+ + break;
721
+ + case StyleName.Text.FontSize:
722
+ + case StyleName.Text.LineHeight:
723
+ + formattedValue = StyleChecker.#ConvertToInt32(fileName, propName, propValue);
724
+ + break;
725
+ + default:
726
+ + formattedValue = StyleFormator.ConvertToString(propName, propValue);
727
+ + break;
728
+ + }
729
+ +
730
+ + return formattedValue;
731
+ + }
732
+ +
733
+ + static #GetMotionValue(fileName, propName, propValue) {
734
+ + // 需要留到执行时处理
735
+ + const formattedValue = StyleFormator.ConvertToString(propName, propValue);
736
+ +
737
+ + return formattedValue;
738
+ + }
739
+ +
740
+ + static #ConvertToInt32(fileName, propName, propValue) {
741
+ + if (propValue.is(StyleValue.DataType.String)) {
742
+ + const strValue = propValue.get();
743
+ + StyleFormator.StringTrim(strValue);
744
+ + if (StyleFormator.StringEndsWith(strValue, "px")) {
745
+ + const fmtValue = StyleFormator.StringToInt32(strValue);
746
+ + const msg = ` Auto optimize style propery ${propName},`
747
+ + + ` convert value from string ${strValue} to number ${fmtValue}.`;
748
+ + Logger.Info(Logger.GetFileTag(fileName), msg);
749
+ + return fmtValue;
750
+ + }
751
+ + }
752
+ +
753
+ + return StyleFormator.ConvertToInt32(propName, propValue);
754
+ + }
755
+ +
756
+ + static #ConvertToColor(fileName, propName, propValue) {
757
+ + const formattedValue = StyleFormator.ConvertToString(propName, propValue);
758
+ + var colorRegex = new RegExp(/^(#([0-9A-Fa-f]{2}){3,4}|rgba?\([\d\s.,-]+\))$/);
759
+ + if(!colorRegex.test(formattedValue)) {
760
+ + const msg = ` style ${propName}: ${propValue} is Invalid.`
761
+ + Logger.Warn(Logger.GetFileTag(fileName), msg);
762
+ + }
763
+ +
764
+ + return formattedValue;
765
+ + }
766
+ +}
767
+ +
768
+ +module.exports = StyleChecker;
769
+
770
+ diff --git a/node_modules/@vue/compiler-sfc/dist/jsview-style-formator.cjs.js b/node_modules/@vue/compiler-sfc/dist/jsview-style-formator.cjs.js
771
+ new file mode 100644
772
+ index 0000000..29ff2ad
773
+ --- /dev/null
774
+ +++ b/node_modules/@vue/compiler-sfc/dist/jsview-style-formator.cjs.js
775
+ @@ -0,0 +1,1211 @@
776
+ +'use strict';
777
+ +
778
+ +Object.defineProperty(exports, '__esModule', { value: true });
779
+ +
780
+ +var Forge = {};
781
+ +
782
+ +class ErrCode {
783
+ + static ToString(value) {
784
+ + switch (value) {
785
+ + case ErrCode.UnknownError:
786
+ + return 'UnknownError(' + value + ')';
787
+ + case ErrCode.UnimplementedError:
788
+ + return 'UnimplementedError(' + value + ')';
789
+ + case ErrCode.UnsupportedError:
790
+ + return 'UnsupportedError(' + value + ')';
791
+ + case ErrCode.NotFoundError:
792
+ + return 'NotFoundError(' + value + ')';
793
+ + case ErrCode.InvalidArgument:
794
+ + return 'InvalidArgument(' + value + ')';
795
+ + case ErrCode.BadArgumentSize:
796
+ + return 'BadArgumentSize(' + value + ')';
797
+ + case ErrCode.InvalidElement:
798
+ + return 'InvalidElement(' + value + ')';
799
+ + case ErrCode.BadElementType:
800
+ + return 'BadElementType(' + value + ')';
801
+ + case ErrCode.CssStyleNotExists:
802
+ + return 'CssStyleNotExists(' + value + ')';
803
+ + case ErrCode.CssStyleNotChanged:
804
+ + return 'CssStyleNotChanged(' + value + ')';
805
+ + case ErrCode.CssStyleBadType:
806
+ + return 'CssStyleBadType(' + value + ')';
807
+ + case ErrCode.CssClassNotChanged:
808
+ + return 'CssClassNotChanged(' + value + ')';
809
+ + case ErrCode.ForgeInsertView:
810
+ + return 'ForgeInsertView(' + value + ')';
811
+ + default:
812
+ + return ("UnknownError(" + value + ")");
813
+ + }
814
+ + }
815
+ + static GetFormattedMethod(prettyFunction) {
816
+ + var begin = 0, length = 0;
817
+ + begin = prettyFunction.indexOf(" ") + 1;
818
+ + length = prettyFunction.indexOf("(") - begin;
819
+ + const method = prettyFunction.substr(begin, length) + "()";
820
+ + return method;
821
+ + }
822
+ + static GetErrorMessage(errMsgs = []) {
823
+ + var oss = "";
824
+ + for (const item of errMsgs) {
825
+ + oss += item;
826
+ + }
827
+ + return oss;
828
+ + }
829
+ + static PrintErrorMessage(fileName, fileLine, errMsgs = []) {
830
+ + const msg = ErrCode.GetErrorMessage(errMsgs);
831
+ + console.error("ForgeDom", "Error@ " + fileName + ":" + fileLine + ", " + msg);
832
+ + }
833
+ + static UnknownError = -1;
834
+ + static UnimplementedError = -2;
835
+ + static UnsupportedError = -3;
836
+ + static NotFoundError = -4;
837
+ + static InvalidArgument = -5;
838
+ + static BadArgumentSize = -6;
839
+ + static InvalidElement = -100;
840
+ + static BadElementType = -101;
841
+ + static BadTaskType = -102;
842
+ + static CssStyleNotExists = -120;
843
+ + static CssStyleNotChanged = -121;
844
+ + static CssStyleBadName = -122;
845
+ + static CssStyleBadType = -123;
846
+ + static CssClassNotChanged = -124;
847
+ + static ForgeInsertView = -200;
848
+ + /*** private ***/
849
+ + constructor() { throw new Error("new ErrCode() is forbidden."); }
850
+ +}
851
+ +function ASSERT_AND_RETPTR(condition, retPtr, errMsgs = []) {
852
+ + ASSERT_AND_RETURN(condition, ErrCode.GetErrorMessage(errMsgs), retPtr);
853
+ +}
854
+ +function CHECK_AND_RETVAL(errCode, retVal, errMsgs = []) {
855
+ + CHECK_AND_RETURN(errCode, ErrCode.GetErrorMessage(errMsgs), retVal);
856
+ +}
857
+ +function CHECK_AND_RETURN(errCode, errMsgs, ret = undefined) {
858
+ + if ((errCode) < 0) {
859
+ + ErrCode.PrintErrorMessage("__FILE_NAME__", "__LINE__", [
860
+ + ErrCode.ToString(errCode), ". ",
861
+ + errMsgs,
862
+ + ]);
863
+ + throw new Error(ret);
864
+ + }
865
+ +}
866
+ +function ASSERT_AND_RETURN(condition, errMsgs, ret = undefined) {
867
+ + if (!(condition)) {
868
+ + ErrCode.PrintErrorMessage("__FILE_NAME__", "__LINE__", [
869
+ + "ASSERT(" + condition + ")", ". ",
870
+ + errMsgs,
871
+ + ]);
872
+ + throw new Error(ret);
873
+ + }
874
+ +}
875
+ +
876
+ +class StyleName {
877
+ + static Layout = class {
878
+ + static Height = "height";
879
+ + static Left = "left";
880
+ + static Top = "top";
881
+ + static Width = "width";
882
+ + constructor() { throw new Error("new StyleName.Layout() is forbidden."); }
883
+ + };
884
+ + static Background = class {
885
+ + static BackgroundColor = "backgroundColor";
886
+ + static BackgroundImage = "backgroundImage";
887
+ + static BorderRadius = "borderRadius";
888
+ + constructor() { throw new Error("new StyleName.Background() is forbidden."); }
889
+ + };
890
+ + static Effect = class {
891
+ + static BackfaceVisibility = "backfaceVisibility";
892
+ + static BorderImage = "borderImage";
893
+ + static BorderImageWidth = "borderImageWidth";
894
+ + static BorderImageOutset = "borderImageOutset";
895
+ + // static ClipPath: string = "clipPath";
896
+ + static Display = "display";
897
+ + static ObjectFit = "objectFit";
898
+ + static Opacity = "opacity";
899
+ + static Overflow = "overflow";
900
+ + static Perspective = "perspective";
901
+ + static PerspectiveOrigin = "perspectiveOrigin";
902
+ + static Transform = "transform";
903
+ + static TransformOrigin = "transformOrigin";
904
+ + static TransformStyle = "transformStyle";
905
+ + static Visibility = "visibility";
906
+ + static ZIndex = "zIndex";
907
+ + constructor() { throw new Error("new StyleName.Effect() is forbidden."); }
908
+ + };
909
+ + static Text = class {
910
+ + static Color = "color";
911
+ + static FontFamily = "fontFamily";
912
+ + static FontSize = "fontSize";
913
+ + static FontStyle = "fontStyle";
914
+ + static FontWeight = "fontWeight";
915
+ + static LineHeight = "lineHeight";
916
+ + static TextAlign = "textAlign";
917
+ + static TextOverflow = "textOverflow";
918
+ + static TextShadow = "textShadow";
919
+ + static WebkitTextStroke = "WebkitTextStroke";
920
+ + static WhiteSpace = "whiteSpace";
921
+ + static WordWrap = "wordWrap";
922
+ + static Direction = "direction";
923
+ + static JsvTextEmoji = "JsvTextEmoji";
924
+ + static JsvTextLatex = "JsvTextLatex";
925
+ + static JsvTextAlignMinWidth = "JsvTextAlignMinWidth";
926
+ + static JsvTextVerticalAlign = "JsvTextVerticalAlign";
927
+ + static JsvTextLineAlign = "JsvTextLineAlign";
928
+ + static JsvTextInnerDirection = "JsvTextInnerDirection";
929
+ + constructor() { throw new Error("new StyleName.Text() is forbidden."); }
930
+ + };
931
+ + static Motion = class {
932
+ + static Animation = "animation";
933
+ + static Transition = "transition";
934
+ + static AnimationFillMode = "animationFillMode";
935
+ + constructor() { throw new Error("new StyleName.Motion() is forbidden."); }
936
+ + };
937
+ + static HasGetterMethod(name) {
938
+ + switch (name) {
939
+ + case StyleName.Layout.Height:
940
+ + case StyleName.Layout.Left:
941
+ + case StyleName.Layout.Top:
942
+ + case StyleName.Layout.Width:
943
+ + case StyleName.Effect.ObjectFit:
944
+ + return true;
945
+ + default:
946
+ + return false;
947
+ + }
948
+ + }
949
+ + static ToConst(name) {
950
+ + if (name == StyleName.Layout.Height) {
951
+ + return StyleName.Layout.Height;
952
+ + }
953
+ + else if (name == StyleName.Layout.Left) {
954
+ + return StyleName.Layout.Left;
955
+ + }
956
+ + else if (name == StyleName.Layout.Top) {
957
+ + return StyleName.Layout.Top;
958
+ + }
959
+ + else if (name == StyleName.Layout.Width) {
960
+ + return StyleName.Layout.Width;
961
+ + }
962
+ + else if (name == StyleName.Background.BackgroundColor) {
963
+ + return StyleName.Background.BackgroundColor;
964
+ + }
965
+ + else if (name == StyleName.Background.BackgroundImage) {
966
+ + return StyleName.Background.BackgroundImage;
967
+ + }
968
+ + else if (name == StyleName.Background.BorderRadius) {
969
+ + return StyleName.Background.BorderRadius;
970
+ + }
971
+ + else if (name == StyleName.Effect.BackfaceVisibility) {
972
+ + return StyleName.Effect.BackfaceVisibility;
973
+ + }
974
+ + else if (name == StyleName.Effect.BorderImage) {
975
+ + return StyleName.Effect.BorderImage;
976
+ + }
977
+ + else if (name == StyleName.Effect.BorderImageWidth) {
978
+ + return StyleName.Effect.BorderImageWidth;
979
+ + }
980
+ + else if (name == StyleName.Effect.BorderImageOutset) {
981
+ + return StyleName.Effect.BorderImageOutset;
982
+ + }
983
+ + // else if (name == StyleName.Effect.ClipPath) { return StyleName.Effect.ClipPath; }
984
+ + else if (name == StyleName.Effect.Display) {
985
+ + return StyleName.Effect.Display;
986
+ + }
987
+ + else if (name == StyleName.Effect.ObjectFit) {
988
+ + return StyleName.Effect.ObjectFit;
989
+ + }
990
+ + else if (name == StyleName.Effect.Opacity) {
991
+ + return StyleName.Effect.Opacity;
992
+ + }
993
+ + else if (name == StyleName.Effect.Overflow) {
994
+ + return StyleName.Effect.Overflow;
995
+ + }
996
+ + else if (name == StyleName.Effect.Perspective) {
997
+ + return StyleName.Effect.Perspective;
998
+ + }
999
+ + else if (name == StyleName.Effect.PerspectiveOrigin) {
1000
+ + return StyleName.Effect.PerspectiveOrigin;
1001
+ + }
1002
+ + else if (name == StyleName.Effect.Transform) {
1003
+ + return StyleName.Effect.Transform;
1004
+ + }
1005
+ + else if (name == StyleName.Effect.TransformOrigin) {
1006
+ + return StyleName.Effect.TransformOrigin;
1007
+ + }
1008
+ + else if (name == StyleName.Effect.TransformStyle) {
1009
+ + return StyleName.Effect.TransformStyle;
1010
+ + }
1011
+ + else if (name == StyleName.Effect.Visibility) {
1012
+ + return StyleName.Effect.Visibility;
1013
+ + }
1014
+ + else if (name == StyleName.Effect.ZIndex) {
1015
+ + return StyleName.Effect.ZIndex;
1016
+ + }
1017
+ + else if (name == StyleName.Text.Color) {
1018
+ + return StyleName.Text.Color;
1019
+ + }
1020
+ + else if (name == StyleName.Text.FontFamily) {
1021
+ + return StyleName.Text.FontFamily;
1022
+ + }
1023
+ + else if (name == StyleName.Text.FontSize) {
1024
+ + return StyleName.Text.FontSize;
1025
+ + }
1026
+ + else if (name == StyleName.Text.FontStyle) {
1027
+ + return StyleName.Text.FontStyle;
1028
+ + }
1029
+ + else if (name == StyleName.Text.FontWeight) {
1030
+ + return StyleName.Text.FontWeight;
1031
+ + }
1032
+ + else if (name == StyleName.Text.LineHeight) {
1033
+ + return StyleName.Text.LineHeight;
1034
+ + }
1035
+ + else if (name == StyleName.Text.TextAlign) {
1036
+ + return StyleName.Text.TextAlign;
1037
+ + }
1038
+ + else if (name == StyleName.Text.TextOverflow) {
1039
+ + return StyleName.Text.TextOverflow;
1040
+ + }
1041
+ + else if (name == StyleName.Text.TextShadow) {
1042
+ + return StyleName.Text.TextShadow;
1043
+ + }
1044
+ + else if (name == StyleName.Text.WebkitTextStroke) {
1045
+ + return StyleName.Text.WebkitTextStroke;
1046
+ + }
1047
+ + else if (name == StyleName.Text.WhiteSpace) {
1048
+ + return StyleName.Text.WhiteSpace;
1049
+ + }
1050
+ + else if (name == StyleName.Text.WordWrap) {
1051
+ + return StyleName.Text.WordWrap;
1052
+ + }
1053
+ + else if (name == StyleName.Text.Direction) {
1054
+ + return StyleName.Text.Direction;
1055
+ + }
1056
+ + else if (name == StyleName.Text.JsvTextEmoji) {
1057
+ + return StyleName.Text.JsvTextEmoji;
1058
+ + }
1059
+ + else if (name == StyleName.Text.JsvTextLatex) {
1060
+ + return StyleName.Text.JsvTextLatex;
1061
+ + }
1062
+ + else if (name == StyleName.Text.JsvTextAlignMinWidth) {
1063
+ + return StyleName.Text.JsvTextAlignMinWidth;
1064
+ + }
1065
+ + else if (name == StyleName.Text.JsvTextVerticalAlign) {
1066
+ + return StyleName.Text.JsvTextVerticalAlign;
1067
+ + }
1068
+ + else if (name == StyleName.Text.JsvTextLineAlign) {
1069
+ + return StyleName.Text.JsvTextLineAlign;
1070
+ + }
1071
+ + else if (name == StyleName.Text.JsvTextInnerDirection) {
1072
+ + return StyleName.Text.JsvTextInnerDirection;
1073
+ + }
1074
+ + else if (name == StyleName.Motion.Animation) {
1075
+ + return StyleName.Motion.Animation;
1076
+ + }
1077
+ + else if (name == StyleName.Motion.Transition) {
1078
+ + return StyleName.Motion.Transition;
1079
+ + }
1080
+ + else if (name == StyleName.Motion.AnimationFillMode) {
1081
+ + return StyleName.Motion.AnimationFillMode;
1082
+ + }
1083
+ + return null;
1084
+ + }
1085
+ + constructor() { throw new Error("new StyleName() is forbidden."); }
1086
+ +}
1087
+ +class StyleValue {
1088
+ + static Base = class {
1089
+ + constructor(rawValue) {
1090
+ + this.rawValue = rawValue;
1091
+ + }
1092
+ + rawValue;
1093
+ + };
1094
+ + static AnimationImpl = class extends StyleValue.Base {
1095
+ + constructor(rawValue) {
1096
+ + super(rawValue);
1097
+ + }
1098
+ + name = "";
1099
+ + duration = 0;
1100
+ + timingFunction = null;
1101
+ + delay = 0;
1102
+ + iterationCount = 0;
1103
+ + direction = false;
1104
+ + };
1105
+ + static CornerImpl = class extends StyleValue.Base {
1106
+ + constructor(rawValue) {
1107
+ + super(rawValue);
1108
+ + }
1109
+ + topLeft = 0;
1110
+ + topRight = 0;
1111
+ + bottomRight = 0;
1112
+ + bottomLeft = 0;
1113
+ + };
1114
+ + static RectImpl = class extends StyleValue.Base {
1115
+ + constructor(rawValue) {
1116
+ + super(rawValue);
1117
+ + }
1118
+ + top = 0;
1119
+ + right = 0;
1120
+ + left = 0;
1121
+ + bottom = 0;
1122
+ + };
1123
+ + static TextShadowImpl = class extends StyleValue.Base {
1124
+ + constructor(rawValue) {
1125
+ + super(rawValue);
1126
+ + }
1127
+ + hShadow = 0;
1128
+ + vShadow = 0;
1129
+ + blur = 0;
1130
+ + color = undefined;
1131
+ + };
1132
+ + static WebkitTextStrokeImpl = class extends StyleValue.Base {
1133
+ + constructor(rawValue) {
1134
+ + super(rawValue);
1135
+ + }
1136
+ + length = 0;
1137
+ + color = undefined;
1138
+ + };
1139
+ + static TransitionImpl = class extends StyleValue.Base {
1140
+ + constructor(rawValue) {
1141
+ + super(rawValue);
1142
+ + }
1143
+ + animationMap = new Map();
1144
+ + };
1145
+ + static BorderImageImpl = class extends StyleValue.Base {
1146
+ + constructor(rawValue) {
1147
+ + super(rawValue);
1148
+ + }
1149
+ + source = "";
1150
+ + slice = null;
1151
+ + };
1152
+ + static BackgroundImageImpl = class extends StyleValue.Base {
1153
+ + constructor(rawValue) {
1154
+ + super(rawValue);
1155
+ + }
1156
+ + type = 0;
1157
+ + static eType = {
1158
+ + UNKNOWN: 0,
1159
+ + LINEAR_GRADIENT: 1,
1160
+ + URL_PATH: 2,
1161
+ + };
1162
+ + static LinearGradient = class {
1163
+ + fromX = 0;
1164
+ + fromY = 0;
1165
+ + toX = 0;
1166
+ + toY = 0;
1167
+ + stops = []; // std::vector<ForgeFront::LinearGradientTexture::StopPoint>
1168
+ + };
1169
+ + linearGradient; // LinearGradient
1170
+ + urlPath = ""; // Image url type
1171
+ + };
1172
+ + static DataType = class {
1173
+ + static Null = 0;
1174
+ + static Int32 = 1;
1175
+ + static Float = 2;
1176
+ + static String = 3;
1177
+ + static Animation = 4;
1178
+ + static Corner = 5;
1179
+ + static Rect = 6;
1180
+ + static TextShadow = 7;
1181
+ + static WebkitTextStroke = 8;
1182
+ + static Transition = 9;
1183
+ + static BorderImage = 10;
1184
+ + static BackgroundImage = 11;
1185
+ + };
1186
+ + static InvalidInt32 = Number.MIN_VALUE;
1187
+ + static InvalidFloat = Number.NaN;
1188
+ + static InvalidPointer = null;
1189
+ + constructor(data) {
1190
+ + let index = -1;
1191
+ + let value = null;
1192
+ + if (data == null) {
1193
+ + index = StyleValue.DataType.Null;
1194
+ + }
1195
+ + else if (Number(data) === data && data % 1 === 0) {
1196
+ + index = StyleValue.DataType.Int32;
1197
+ + }
1198
+ + else if (Number(data) === data && data % 1 !== 0) {
1199
+ + index = StyleValue.DataType.Float;
1200
+ + }
1201
+ + else if (typeof data === 'string' || data instanceof String) {
1202
+ + index = StyleValue.DataType.String;
1203
+ + }
1204
+ + else if (data instanceof StyleValue.AnimationImpl) {
1205
+ + index = StyleValue.DataType.Animation;
1206
+ + }
1207
+ + else if (data instanceof StyleValue.CornerImpl) {
1208
+ + index = StyleValue.DataType.Corner;
1209
+ + }
1210
+ + else if (data instanceof StyleValue.RectImpl) {
1211
+ + index = StyleValue.DataType.Rect;
1212
+ + }
1213
+ + else if (data instanceof StyleValue.TextShadowImpl) {
1214
+ + index = StyleValue.DataType.TextShadow;
1215
+ + }
1216
+ + else if (data instanceof StyleValue.WebkitTextStrokeImpl) {
1217
+ + index = StyleValue.DataType.WebkitTextStroke;
1218
+ + }
1219
+ + else if (data instanceof StyleValue.TransitionImpl) {
1220
+ + index = StyleValue.DataType.Transition;
1221
+ + }
1222
+ + else if (data instanceof StyleValue.BorderImageImpl) {
1223
+ + index = StyleValue.DataType.BorderImage;
1224
+ + }
1225
+ + if (data != StyleValue.InvalidInt32
1226
+ + && data != StyleValue.InvalidFloat
1227
+ + && data != StyleValue.InvalidPointer) {
1228
+ + value = data;
1229
+ + }
1230
+ + else {
1231
+ + index = StyleValue.DataType.Null;
1232
+ + value = null;
1233
+ + }
1234
+ + this.data = new StyleValue.DataInfo();
1235
+ + this.data.index = index;
1236
+ + this.data.value = value;
1237
+ + }
1238
+ + toString() {
1239
+ + let result = null;
1240
+ + switch (this.data.index) {
1241
+ + case StyleValue.DataType.Null:
1242
+ + return "";
1243
+ + case StyleValue.DataType.Int32:
1244
+ + return String(this.get());
1245
+ + case StyleValue.DataType.Float:
1246
+ + return String(this.get());
1247
+ + case StyleValue.DataType.String:
1248
+ + result = this.get();
1249
+ + break;
1250
+ + case StyleValue.DataType.Animation:
1251
+ + result = this.get().rawValue;
1252
+ + break;
1253
+ + case StyleValue.DataType.Corner:
1254
+ + result = this.get().rawValue;
1255
+ + break;
1256
+ + case StyleValue.DataType.Rect:
1257
+ + result = this.get().rawValue;
1258
+ + break;
1259
+ + case StyleValue.DataType.TextShadow:
1260
+ + result = this.get().rawValue;
1261
+ + break;
1262
+ + case StyleValue.DataType.WebkitTextStroke:
1263
+ + result = this.get().rawValue;
1264
+ + break;
1265
+ + case StyleValue.DataType.Transition:
1266
+ + result = this.get().rawValue;
1267
+ + break;
1268
+ + case StyleValue.DataType.BorderImage:
1269
+ + result = this.get().rawValue;
1270
+ + break;
1271
+ + case StyleValue.DataType.BackgroundImage:
1272
+ + result = this.get().rawValue;
1273
+ + break;
1274
+ + default:
1275
+ + console.error("Failed to do StyleValue.toString()");
1276
+ + break;
1277
+ + }
1278
+ + return result ?? "";
1279
+ + }
1280
+ + is(type) {
1281
+ + return this.data.index == type;
1282
+ + }
1283
+ + get() {
1284
+ + return this.data.value;
1285
+ + }
1286
+ + reset(rhs) {
1287
+ + this.data.value = rhs.data.value;
1288
+ + this.data.index = rhs.data.index;
1289
+ + }
1290
+ + equals(rhs) {
1291
+ + return (this.data.value === rhs.data.value
1292
+ + && this.data.index === rhs.data.index);
1293
+ + }
1294
+ + static DataInfo = class {
1295
+ + value = null;
1296
+ + index = -1;
1297
+ + };
1298
+ + data;
1299
+ +}
1300
+ +class StyleVariable {
1301
+ + static FormatVariableName(varName) {
1302
+ + if (varName.startsWith('--')) {
1303
+ + return 'var(' + varName + ')'; // var(--xxx)
1304
+ + }
1305
+ + else if (varName.startsWith('var(--')) {
1306
+ + return varName;
1307
+ + }
1308
+ + ASSERT_AND_RETPTR(false, null);
1309
+ + return null;
1310
+ + }
1311
+ + static IsVariable(value) {
1312
+ + let variable;
1313
+ + if (value instanceof StyleValue) {
1314
+ + if (value.is(StyleValue.DataType.String) == false) {
1315
+ + return false;
1316
+ + }
1317
+ + variable = value.get();
1318
+ + }
1319
+ + else if (typeof value === 'string') {
1320
+ + variable = value;
1321
+ + }
1322
+ + else {
1323
+ + return false;
1324
+ + }
1325
+ + const isVar = (variable.startsWith("--") || variable.startsWith("var(--"));
1326
+ + return isVar;
1327
+ + }
1328
+ + constructor() { throw new Error("new StyleVariable() is forbidden."); }
1329
+ +}
1330
+ +
1331
+ +let ForgeFront = Forge;
1332
+ +class StyleFormator {
1333
+ + /*** public ***/
1334
+ + static StringToInt32(value) {
1335
+ + let ret = StyleValue.InvalidInt32;
1336
+ + let int32Value = parseInt(value);
1337
+ + if (isNaN(int32Value) == false) {
1338
+ + ret = int32Value;
1339
+ + }
1340
+ + return ret;
1341
+ + }
1342
+ + static StringTrim(value) {
1343
+ + return value.trim();
1344
+ + }
1345
+ + static StringStartsWith(value, starting) {
1346
+ + return value.startsWith(starting);
1347
+ + }
1348
+ + static StringEndsWith(value, ending) {
1349
+ + return value.endsWith(ending);
1350
+ + }
1351
+ + static StringSplit(from, delimiter = " ", startIdx = 0, endIdx = 0, doTrim = false) {
1352
+ + if (!from) {
1353
+ + from = "";
1354
+ + }
1355
+ + // apply startIdx/endIdx
1356
+ + if (endIdx == 0) {
1357
+ + // 0代表全字符
1358
+ + endIdx = from.length - 1;
1359
+ + }
1360
+ + from = from.substring(startIdx, endIdx + 1);
1361
+ + let arrays = from.trim().split(delimiter);
1362
+ + // 去除多个空格的条件下的影响
1363
+ + // 结果string进行trim
1364
+ + let ret = [];
1365
+ + for (let item of arrays) {
1366
+ + if (!item) {
1367
+ + continue;
1368
+ + }
1369
+ + if (doTrim) {
1370
+ + item = item.trim();
1371
+ + if (item.length == 0) {
1372
+ + continue;
1373
+ + }
1374
+ + }
1375
+ + ret.push(item);
1376
+ + }
1377
+ + return ret;
1378
+ + }
1379
+ + static MergeBrackets(input, connector = null) {
1380
+ + let output = [];
1381
+ + let packString = "";
1382
+ + let notMergedPrevious = null;
1383
+ + let mergedString = null;
1384
+ + let bracket_depth = 0;
1385
+ + let useSstream = false;
1386
+ + for (let str of input) {
1387
+ + let start_pos = 0;
1388
+ + while (start_pos < str.length) {
1389
+ + if (bracket_depth > 0) {
1390
+ + let end_pos = str.indexOf(")", start_pos);
1391
+ + let next_bracket_pos = str.indexOf("(", start_pos);
1392
+ + if (next_bracket_pos != -1 && (end_pos == -1 || next_bracket_pos < end_pos)) {
1393
+ + bracket_depth++;
1394
+ + start_pos = next_bracket_pos + 1;
1395
+ + }
1396
+ + else {
1397
+ + // 到目前为止没有深度增加
1398
+ + // 可能1: 有新正括号,但晚于反括号
1399
+ + // 可能2: 无新正括号,有反括号
1400
+ + // 可能3: 无新正括号,也无反括号
1401
+ + if (end_pos >= 0) {
1402
+ + // 上诉的可能1或可能2
1403
+ + bracket_depth--;
1404
+ + // 以反括号为节点继续后查
1405
+ + // 在新正括号在反括号之后的场景放到下一次循环来处理
1406
+ + start_pos = end_pos + 1;
1407
+ + }
1408
+ + else {
1409
+ + // 上诉的可能3
1410
+ + // 不需要后续的检查,保存depth状态,跳到下一个内容
1411
+ + break;
1412
+ + }
1413
+ + }
1414
+ + }
1415
+ + else {
1416
+ + let bracket_pos = str.indexOf("(", start_pos);
1417
+ + if (bracket_pos == -1) {
1418
+ + break;
1419
+ + }
1420
+ + bracket_depth++;
1421
+ + start_pos = bracket_pos + 1;
1422
+ + }
1423
+ + }
1424
+ + // 执行本次合并
1425
+ + if (useSstream) {
1426
+ + // 第三个及以上合并内容
1427
+ + if (connector) {
1428
+ + packString += connector;
1429
+ + }
1430
+ + packString += str;
1431
+ + }
1432
+ + else if (notMergedPrevious != null) {
1433
+ + // 第二个合并内容
1434
+ + packString += notMergedPrevious;
1435
+ + if (connector) {
1436
+ + packString += connector;
1437
+ + }
1438
+ + packString += str;
1439
+ + notMergedPrevious = null;
1440
+ + useSstream = true;
1441
+ + }
1442
+ + else {
1443
+ + // 第一个合并内容
1444
+ + notMergedPrevious = str; // 记录previousString
1445
+ + }
1446
+ + if (bracket_depth == 0) {
1447
+ + // 收尾
1448
+ + if (useSstream) {
1449
+ + mergedString = packString;
1450
+ + packString = "";
1451
+ + }
1452
+ + else {
1453
+ + mergedString = str;
1454
+ + }
1455
+ + output.push(mergedString);
1456
+ + // 重置所有状态
1457
+ + notMergedPrevious = null;
1458
+ + useSstream = false;
1459
+ + }
1460
+ + }
1461
+ + return output;
1462
+ + }
1463
+ + static ConvertToInt32(name, value) {
1464
+ + if (value.is(StyleValue.DataType.Null)) {
1465
+ + return 0;
1466
+ + }
1467
+ + else if (value.is(StyleValue.DataType.String)) {
1468
+ + const strValue = value.get();
1469
+ + if (strValue === "") {
1470
+ + return 0;
1471
+ + }
1472
+ + else {
1473
+ + StyleFormator.StringTrim(strValue);
1474
+ + if (StyleFormator.StringEndsWith(strValue, "px")) {
1475
+ + const msg = 'JsView Warning:'
1476
+ + + ' Using px will make style performance lower,'
1477
+ + + ' you can directly use numbers instead of "' + strValue + '".';
1478
+ + console.warn(msg);
1479
+ + }
1480
+ + return StyleFormator.StringToInt32(strValue);
1481
+ + }
1482
+ + }
1483
+ + else if (value.is(StyleValue.DataType.Int32)) {
1484
+ + return value.get();
1485
+ + }
1486
+ + else if (value.is(StyleValue.DataType.Float)) {
1487
+ + return value.get();
1488
+ + }
1489
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidInt32, [
1490
+ + 'Failed to convert style ',
1491
+ + name, '=', value.toString(),
1492
+ + ', value type is supported.'
1493
+ + ]);
1494
+ + return StyleValue.InvalidInt32;
1495
+ + }
1496
+ + static ConvertToFloat(name, value) {
1497
+ + if (value.is(StyleValue.DataType.Null)) {
1498
+ + return StyleValue.InvalidFloat;
1499
+ + }
1500
+ + else if (value.is(StyleValue.DataType.String) && value.get() === "") {
1501
+ + return 0;
1502
+ + }
1503
+ + else if (value.is(StyleValue.DataType.Int32)) {
1504
+ + return value.get();
1505
+ + }
1506
+ + else if (value.is(StyleValue.DataType.Float)) {
1507
+ + return value.get();
1508
+ + }
1509
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidFloat, [
1510
+ + "Failed to convert style ",
1511
+ + name, '=', value.toString(),
1512
+ + ", value type is supported."
1513
+ + ]);
1514
+ + return StyleValue.InvalidFloat;
1515
+ + }
1516
+ + static ConvertToString(name, value, upperCase = false) {
1517
+ + if (value.is(StyleValue.DataType.Null)) {
1518
+ + return StyleValue.InvalidPointer;
1519
+ + }
1520
+ + if (value.is(StyleValue.DataType.String) == false) {
1521
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidPointer, [
1522
+ + "Failed to convert style ",
1523
+ + name, '=', value.toString(),
1524
+ + ", type is not string."
1525
+ + ]);
1526
+ + }
1527
+ + let propValue = value.get();
1528
+ + if (propValue == null || propValue.length <= 0) {
1529
+ + return StyleValue.InvalidPointer;
1530
+ + }
1531
+ + if (upperCase) {
1532
+ + propValue = propValue.toUpperCase();
1533
+ + }
1534
+ + return propValue;
1535
+ + }
1536
+ + static ConvertToCorner(name, value) {
1537
+ + if (value.is(StyleValue.DataType.Null)) {
1538
+ + return StyleValue.InvalidPointer;
1539
+ + }
1540
+ + let corner = null;
1541
+ + if (value.is(StyleValue.DataType.Int32)) {
1542
+ + const propValue = value.get();
1543
+ + corner = new StyleValue.CornerImpl(String(propValue));
1544
+ + corner.topLeft = propValue;
1545
+ + corner.topRight = propValue;
1546
+ + corner.bottomRight = propValue;
1547
+ + corner.bottomLeft = propValue;
1548
+ + }
1549
+ + else if (value.is(StyleValue.DataType.String)) {
1550
+ + const propValue = value.get();
1551
+ + if (propValue == null || propValue.length <= 0) {
1552
+ + return StyleValue.InvalidPointer;
1553
+ + }
1554
+ + const propValueArray = StyleFormator.StringSplit(propValue);
1555
+ + const propValueSize = propValueArray.length;
1556
+ + corner = new StyleValue.CornerImpl(propValue);
1557
+ + corner.topLeft = (propValueSize > 0 ? parseInt(propValueArray[0]) : 0);
1558
+ + corner.topRight = (propValueSize > 1 ? parseInt(propValueArray[1]) : corner.topLeft);
1559
+ + corner.bottomRight = (propValueSize > 2 ? parseInt(propValueArray[2]) : corner.topLeft);
1560
+ + corner.bottomLeft = (propValueSize > 3 ? parseInt(propValueArray[3]) : corner.bottomRight);
1561
+ + }
1562
+ + else {
1563
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidPointer, [
1564
+ + "Failed to convert style ",
1565
+ + name, '=', value.toString(),
1566
+ + ", type is not number or string."
1567
+ + ]);
1568
+ + }
1569
+ + return corner;
1570
+ + }
1571
+ + static ConvertToRect(name, value) {
1572
+ + if (value.is(StyleValue.DataType.Null)) {
1573
+ + return StyleValue.InvalidPointer;
1574
+ + }
1575
+ + if (value.is(StyleValue.DataType.String) == false) {
1576
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidPointer, ['Failed to convert style ' + name + '=' + value + ', value type is not string.']);
1577
+ + }
1578
+ + const propValue = value.get();
1579
+ + if (propValue == null || propValue.length <= 0) {
1580
+ + return StyleValue.InvalidPointer;
1581
+ + }
1582
+ + const rect = new StyleValue.RectImpl(propValue);
1583
+ + const propValueArray = StyleFormator.StringSplit(propValue);
1584
+ + const propValueSize = propValueArray.length;
1585
+ + rect.top = (propValueSize > 0 ? parseInt(propValueArray[0]) : 0);
1586
+ + rect.right = (propValueSize > 1 ? parseInt(propValueArray[1]) : rect.top);
1587
+ + rect.bottom = (propValueSize > 2 ? parseInt(propValueArray[2]) : rect.top);
1588
+ + rect.left = (propValueSize > 3 ? parseInt(propValueArray[3]) : rect.right);
1589
+ + return rect;
1590
+ + }
1591
+ + static ConvertToAnimation(name, value, compare = null) {
1592
+ + if (value.is(StyleValue.DataType.Null)) {
1593
+ + return StyleValue.InvalidPointer;
1594
+ + }
1595
+ + if (value.is(StyleValue.DataType.String) == false) {
1596
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidPointer, [
1597
+ + "Failed to convert style ",
1598
+ + name, '=', value.toString(),
1599
+ + ", type is not string."
1600
+ + ]);
1601
+ + }
1602
+ + const propValue = value.get();
1603
+ + if (propValue == null || propValue.length <= 0) {
1604
+ + return StyleValue.InvalidPointer;
1605
+ + }
1606
+ + // 和compare相同,直接返回compare加速
1607
+ + if (compare != null && compare.rawValue != null
1608
+ + && compare.rawValue == propValue) {
1609
+ + return compare;
1610
+ + }
1611
+ + const anim = StyleFormator.ParseToAnimation(propValue);
1612
+ + return anim;
1613
+ + }
1614
+ + static ConvertToTransition(name, value, compare = null) {
1615
+ + if (value.is(StyleValue.DataType.Null)) {
1616
+ + return StyleValue.InvalidPointer;
1617
+ + }
1618
+ + if (value.is(StyleValue.DataType.String) == false) {
1619
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidPointer, [
1620
+ + "Failed to convert style ",
1621
+ + name, '=', value.toString(),
1622
+ + ", type is not string."
1623
+ + ]);
1624
+ + }
1625
+ + const propValue = value.get();
1626
+ + if (propValue == null || propValue.length <= 0) {
1627
+ + return StyleValue.InvalidPointer;
1628
+ + }
1629
+ + // 和compare相同,直接返回compare加速
1630
+ + if (compare != null && compare.rawValue != null
1631
+ + && compare.rawValue == propValue) {
1632
+ + return compare;
1633
+ + }
1634
+ + let arrays = [];
1635
+ + const splitStr = StyleFormator.StringSplit(propValue, ",");
1636
+ + // 如果包含"(", 则将直到")"为止的内容当作一个部分
1637
+ + for (let idx = 0; idx < splitStr.length; idx++) {
1638
+ + if (splitStr[idx].indexOf('(') >= 0) {
1639
+ + let endIdx = idx;
1640
+ + while (endIdx < splitStr.length && splitStr[endIdx].indexOf(')') < 0) { // 没有包含")"
1641
+ + endIdx++;
1642
+ + }
1643
+ + let concatStr = "";
1644
+ + for (let subIdx = idx; subIdx <= endIdx; subIdx++) {
1645
+ + if (subIdx != idx) {
1646
+ + concatStr += ",";
1647
+ + }
1648
+ + concatStr += splitStr[subIdx];
1649
+ + }
1650
+ + idx = endIdx;
1651
+ + arrays.push(concatStr);
1652
+ + }
1653
+ + else {
1654
+ + arrays.push(splitStr[idx]);
1655
+ + }
1656
+ + }
1657
+ + // console.warn("StyleFormator.ConvertToTransition() arrays=" + JSON.stringify(arrays));
1658
+ + const transition = new StyleValue.TransitionImpl(propValue);
1659
+ + for (const item of arrays) {
1660
+ + const ret = StyleFormator.ConvertToAnimation(name, new StyleValue(item));
1661
+ + if (ret == null) {
1662
+ + continue;
1663
+ + }
1664
+ + transition.animationMap.set(ret.name, ret);
1665
+ + if (ret?.name == "all") {
1666
+ + const allProps = ["opacity", "left", "top", "width", "height", "transform"];
1667
+ + for (const prop of allProps) {
1668
+ + transition.animationMap.set(prop, ret);
1669
+ + }
1670
+ + }
1671
+ + }
1672
+ + return transition;
1673
+ + }
1674
+ + static ConvertToTextShadow(name, value) {
1675
+ + if (value.is(StyleValue.DataType.Null)) {
1676
+ + return StyleValue.InvalidPointer;
1677
+ + }
1678
+ + if (value.is(StyleValue.DataType.String) == false) {
1679
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidPointer, [
1680
+ + "Failed to convert style ",
1681
+ + name, '=', value.toString(),
1682
+ + ", type is not string."
1683
+ + ]);
1684
+ + }
1685
+ + const propValue = value.get();
1686
+ + if (propValue == null || propValue.length <= 0) {
1687
+ + return StyleValue.InvalidPointer;
1688
+ + }
1689
+ + const textShadow = new StyleValue.TextShadowImpl(propValue);
1690
+ + const textShadowArray = StyleFormator.StringSplit(propValue);
1691
+ + if (textShadowArray.length > 0) {
1692
+ + textShadow.hShadow = parseInt(textShadowArray[0]);
1693
+ + }
1694
+ + if (textShadowArray.length > 1) {
1695
+ + textShadow.vShadow = parseInt(textShadowArray[1]);
1696
+ + }
1697
+ + if (textShadowArray.length > 2) {
1698
+ + textShadow.blur = parseInt(textShadowArray[2]);
1699
+ + }
1700
+ + let colorIndex = -1;
1701
+ + if (textShadowArray.length == 3) {
1702
+ + colorIndex = 2;
1703
+ + }
1704
+ + else if (textShadowArray.length > 3) {
1705
+ + colorIndex = 3;
1706
+ + }
1707
+ + if (colorIndex > 0) {
1708
+ + textShadow.color = textShadowArray[colorIndex];
1709
+ + }
1710
+ + return textShadow;
1711
+ + }
1712
+ + static ConvertToWebkitTextStroke(name, value) {
1713
+ + if (value.is(StyleValue.DataType.Null)) {
1714
+ + return StyleValue.InvalidPointer;
1715
+ + }
1716
+ + if (value.is(StyleValue.DataType.String) == false) {
1717
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidPointer, [
1718
+ + "Failed to convert style ",
1719
+ + name, '=', value.toString(),
1720
+ + ", type is not string."
1721
+ + ]);
1722
+ + }
1723
+ + const propValue = value.get();
1724
+ + if (propValue == null || propValue.length <= 0) {
1725
+ + return StyleValue.InvalidPointer;
1726
+ + }
1727
+ + const webkitTextStroke = new StyleValue.WebkitTextStrokeImpl(propValue);
1728
+ + const webkitTextStrokeArray = StyleFormator.StringSplit(propValue);
1729
+ + if (webkitTextStrokeArray.length > 0) {
1730
+ + webkitTextStroke.length = parseInt(webkitTextStrokeArray[0]);
1731
+ + }
1732
+ + if (webkitTextStrokeArray.length > 1) {
1733
+ + webkitTextStroke.color = webkitTextStrokeArray[1];
1734
+ + }
1735
+ + return webkitTextStroke;
1736
+ + }
1737
+ + static ConvertToBorderImage(name, value) {
1738
+ + if (value.is(StyleValue.DataType.Null)) {
1739
+ + return StyleValue.InvalidPointer;
1740
+ + }
1741
+ + if (value.is(StyleValue.DataType.String) == false) {
1742
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidPointer, [
1743
+ + "Failed to convert style ",
1744
+ + name, '=', value.toString(),
1745
+ + ", type is not string."
1746
+ + ]);
1747
+ + }
1748
+ + const propValue = value.get();
1749
+ + if (propValue == null || propValue.length <= 0) {
1750
+ + return StyleValue.InvalidPointer;
1751
+ + }
1752
+ + const borderImage = new StyleValue.BorderImageImpl(propValue);
1753
+ + const propValueArray = StyleFormator.StringSplit(propValue);
1754
+ + const propValueSize = propValueArray.length;
1755
+ + if (propValueSize > 0) {
1756
+ + borderImage.source = propValueArray[0];
1757
+ + }
1758
+ + if (propValueSize > 1) {
1759
+ + borderImage.slice = StyleFormator.ConvertToRect(name, new StyleValue(propValueArray[1]));
1760
+ + }
1761
+ + return borderImage;
1762
+ + }
1763
+ + static ConvertToBackgroundImage(name, value) {
1764
+ + if (value.is(StyleValue.DataType.Null)) {
1765
+ + return StyleValue.InvalidPointer;
1766
+ + }
1767
+ + if (value.is(StyleValue.DataType.String) == false) {
1768
+ + CHECK_AND_RETVAL(ErrCode.InvalidArgument, StyleValue.InvalidPointer, [
1769
+ + "Failed to convert style ",
1770
+ + name, '=', value.toString(),
1771
+ + ", type is not string."
1772
+ + ]);
1773
+ + }
1774
+ + let propValue = value.get();
1775
+ + if (propValue == null || propValue.length <= 0) {
1776
+ + return StyleValue.InvalidPointer;
1777
+ + }
1778
+ + const backgroundImage = new StyleValue.BackgroundImageImpl(propValue);
1779
+ + const gradientPrefix = "linear-gradient(";
1780
+ + if (propValue.indexOf(gradientPrefix) == 0) {
1781
+ + propValue = StyleFormator.StringTrim(propValue);
1782
+ + backgroundImage.type = StyleValue.BackgroundImageImpl.eType.LINEAR_GRADIENT;
1783
+ + backgroundImage.linearGradient = new StyleValue.BackgroundImageImpl.LinearGradient();
1784
+ + backgroundImage.urlPath = propValue;
1785
+ + let propValueArray = StyleFormator.StringSplit(propValue, ",", gradientPrefix.length, propValue.length - 2 /* 去掉最后的括号 */);
1786
+ + propValueArray = StyleFormator.MergeBrackets(propValueArray, ",");
1787
+ + let propValueSize = propValueArray.length;
1788
+ + if (propValueSize > 0) {
1789
+ + // check direction
1790
+ + let firstDefine = propValueArray[0];
1791
+ + if (firstDefine.indexOf("to ") != -1) {
1792
+ + propValueArray.splice(0, 1); // 删除头结点
1793
+ + let stopsCount = propValueArray.length;
1794
+ + if (firstDefine.indexOf("left") != -1) {
1795
+ + // 向左
1796
+ + backgroundImage.linearGradient.fromX = stopsCount + 1;
1797
+ + backgroundImage.linearGradient.toX = 0;
1798
+ + }
1799
+ + else if (firstDefine.indexOf("right") != -1) {
1800
+ + // 向右
1801
+ + backgroundImage.linearGradient.fromX = 0;
1802
+ + backgroundImage.linearGradient.toX = stopsCount + 1;
1803
+ + }
1804
+ + else {
1805
+ + // X上无方向
1806
+ + backgroundImage.linearGradient.fromX = 0;
1807
+ + backgroundImage.linearGradient.toX = 0;
1808
+ + }
1809
+ + if (firstDefine.indexOf("top") != -1) {
1810
+ + // 向上
1811
+ + backgroundImage.linearGradient.fromY = stopsCount + 1;
1812
+ + backgroundImage.linearGradient.toY = 0;
1813
+ + }
1814
+ + else if (firstDefine.indexOf("bottom") != -1) {
1815
+ + // 向下
1816
+ + backgroundImage.linearGradient.fromY = 0;
1817
+ + backgroundImage.linearGradient.toY = stopsCount + 1;
1818
+ + }
1819
+ + else {
1820
+ + // Y上无方向
1821
+ + backgroundImage.linearGradient.fromY = 0;
1822
+ + backgroundImage.linearGradient.toY = 0;
1823
+ + }
1824
+ + }
1825
+ + else {
1826
+ + // 默认从上到下
1827
+ + backgroundImage.linearGradient.fromX = 0;
1828
+ + backgroundImage.linearGradient.toX = 0;
1829
+ + backgroundImage.linearGradient.fromY = 0;
1830
+ + backgroundImage.linearGradient.toY = 2;
1831
+ + }
1832
+ + }
1833
+ + if (propValueSize < 2) {
1834
+ + // stops 颜色值不足,至少应该有起始和结束两种颜色
1835
+ + console.error(`linear gradient format error: str=${value}`);
1836
+ + return null;
1837
+ + }
1838
+ + let stepGap = 1 / propValueArray.length;
1839
+ + let stopsCount = propValueArray.length;
1840
+ + for (let i = 0; i < stopsCount; i++) {
1841
+ + let stopColor = propValueArray[i];
1842
+ + stopColor = StyleFormator.StringTrim(stopColor);
1843
+ + let stopPoint = new ForgeFront.LinearGradientTexture.StopPoint();
1844
+ + stopPoint.color = stopColor;
1845
+ + stopPoint.stopPosition = (i != stopsCount - 1 ? i * stepGap : 1);
1846
+ + backgroundImage.linearGradient.stops.push(stopPoint);
1847
+ + }
1848
+ + }
1849
+ + else {
1850
+ + // Url path形式
1851
+ + backgroundImage.type = StyleValue.BackgroundImageImpl.eType.URL_PATH;
1852
+ + backgroundImage.urlPath = propValue;
1853
+ + }
1854
+ + return backgroundImage;
1855
+ + }
1856
+ + static ParseToAnimation(value) {
1857
+ + const trimmed = StyleFormator.StringTrim(value);
1858
+ + let arrays = [];
1859
+ + const bezierStart = trimmed.indexOf("cubic-bezier");
1860
+ + if (bezierStart >= 0) { // 防止贝塞尔里面的空格被拆分
1861
+ + const bezierEnd = trimmed.indexOf(')');
1862
+ + const bezierStr = trimmed.substring(bezierStart, bezierEnd - 1);
1863
+ + const bezierArray = StyleFormator.StringSplit(trimmed, bezierStr);
1864
+ + for (const item of bezierArray) {
1865
+ + const subArrays = StyleFormator.StringSplit(item);
1866
+ + arrays = [...arrays, ...subArrays];
1867
+ + }
1868
+ + arrays.push(bezierStr);
1869
+ + }
1870
+ + else {
1871
+ + arrays = StyleFormator.StringSplit(trimmed);
1872
+ + }
1873
+ + // 下面四个属性在animation字符串中是无序的,所以需要单独判断。
1874
+ + let timingFunction = "";
1875
+ + let delay = 0;
1876
+ + let iterationCount = 1;
1877
+ + let direction = (trimmed.indexOf("alternate") >= 0);
1878
+ + for (var idx = 2; idx < arrays.length; idx++) { // 前两个选项固定是name和duration
1879
+ + if (arrays[idx] == "infinite") {
1880
+ + iterationCount = -1; // -1表示无限循环
1881
+ + continue;
1882
+ + }
1883
+ + let num = StyleFormator.ParseToTimeMs(arrays[idx]);
1884
+ + if (isNaN(num) == false) { // 表示时间
1885
+ + delay = num;
1886
+ + }
1887
+ + else {
1888
+ + num = StyleFormator.ParseToFloat(arrays[idx]);
1889
+ + if (isNaN(num) == false) { // 表示次数
1890
+ + iterationCount = num;
1891
+ + }
1892
+ + else { // 不是数字,直接赋给timingFunction,省略判断
1893
+ + timingFunction = arrays[idx];
1894
+ + }
1895
+ + }
1896
+ + }
1897
+ + const duration = arrays.length > 1 ? StyleFormator.ParseToTimeMs(arrays[1]) : 0.0;
1898
+ + const anim = new StyleValue.AnimationImpl(trimmed);
1899
+ + anim.name = arrays.length > 0 ? arrays[0] : "";
1900
+ + anim.duration = duration;
1901
+ + anim.timingFunction = StyleFormator.ParseToEasing(timingFunction, duration);
1902
+ + anim.delay = delay;
1903
+ + anim.iterationCount = iterationCount;
1904
+ + anim.direction = direction;
1905
+ + // .originStr = propValue,
1906
+ + return anim;
1907
+ + }
1908
+ + static ParseToTimeMs(from) {
1909
+ + if (StyleFormator.StringEndsWith(from, "s") == false) { // ms / s
1910
+ + return NaN;
1911
+ + }
1912
+ + let timing = StyleFormator.ParseToFloat(from);
1913
+ + if (StyleFormator.StringEndsWith(from, "ms")) {
1914
+ + timing *= 1.0;
1915
+ + }
1916
+ + else if (StyleFormator.StringEndsWith(from, "s")) {
1917
+ + timing *= 1000.0;
1918
+ + }
1919
+ + // timing *= std::stof(from);
1920
+ + return timing;
1921
+ + }
1922
+ + static ParseToFloat(from) {
1923
+ + const trimmed = StyleFormator.StringTrim(from);
1924
+ + return parseFloat(trimmed);
1925
+ + }
1926
+ + static ParseToEasing(from, duration) {
1927
+ + let easing = null;
1928
+ + if (from.indexOf("ease") >= 0) {
1929
+ + if (from.indexOf("-in-out") >= 0) {
1930
+ + easing = Forge.Easing.Circular.InOut;
1931
+ + }
1932
+ + else if (from.indexOf("-out") >= 0) {
1933
+ + easing = Forge.Easing.Circular.Out;
1934
+ + }
1935
+ + else if (from.indexOf("-in") >= 0) {
1936
+ + easing = Forge.Easing.Circular.In;
1937
+ + }
1938
+ + else {
1939
+ + easing = Forge.Easing.Circular.InOut;
1940
+ + }
1941
+ + }
1942
+ + else if (from.indexOf("linear") >= 0) {
1943
+ + easing = null; // null是匀速动画
1944
+ + }
1945
+ + else if (from.indexOf("cubic-bezier") >= 0) {
1946
+ + easing = StyleFormator.ParseToEasingBezier(from, duration);
1947
+ + }
1948
+ + else if (from.indexOf("steps") >= 0) {
1949
+ + easing = StyleFormator.ParseToEasingSteps(from);
1950
+ + }
1951
+ + return easing;
1952
+ + }
1953
+ + static ParseToEasingBezier(jsDescribe, duration) {
1954
+ + let startIdx = jsDescribe.indexOf('(');
1955
+ + if (startIdx >= 0) {
1956
+ + jsDescribe = jsDescribe.substring(startIdx + 1);
1957
+ + }
1958
+ + let arrays = StyleFormator.StringSplit(jsDescribe, ',');
1959
+ + let bezier = {
1960
+ + x1: arrays.length > 0 ? parseFloat(arrays[0]) : 0,
1961
+ + y1: arrays.length > 1 ? parseFloat(arrays[1]) : 0,
1962
+ + x2: arrays.length > 2 ? parseFloat(arrays[2]) : 0,
1963
+ + y2: arrays.length > 3 ? parseFloat(arrays[3]) : 0,
1964
+ + };
1965
+ + return new Forge.BezierEasing(bezier.x1, bezier.y1, bezier.x2, bezier.y2, duration);
1966
+ + }
1967
+ + static ParseToEasingSteps(jsDescribe) {
1968
+ + let startIdx = jsDescribe.indexOf('(');
1969
+ + if (startIdx >= 0) {
1970
+ + jsDescribe = jsDescribe.substring(startIdx + 1);
1971
+ + }
1972
+ + let arrays = StyleFormator.StringSplit(jsDescribe, ',');
1973
+ + let steps = {
1974
+ + steps: arrays.length > 0 ? parseInt(arrays[0]) : 1,
1975
+ + type: arrays.length > 1 ? (arrays[1].includes("start") ? 0 : 1) : 0,
1976
+ + };
1977
+ + return new Forge.StepsEasing(steps.steps, steps.type);
1978
+ + }
1979
+ + constructor() { throw new Error("new StyleGroup() is forbidden."); }
1980
+ +}
1981
+ +
1982
+ +exports.StyleFormator = StyleFormator;
1983
+ +exports.StyleName = StyleName;
1984
+ +exports.StyleValue = StyleValue;
1985
+ +exports.StyleVariable = StyleVariable;
1986
+ +//# sourceMappingURL=jsview-style-formator.cjs.js.map