@visactor/vrender-kits 0.17.25 → 0.17.26-alpha.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.
@@ -162,6 +162,8 @@ export declare class BrowserContext2d implements IContext2d {
162
162
  wrap: boolean;
163
163
  whiteSpace: "normal" | "no-wrap";
164
164
  suffixPosition: "start" | "end" | "middle";
165
+ underlineDash: number[];
166
+ underlineOffset: number;
165
167
  disableAutoClipedPoptip: boolean;
166
168
  };
167
169
  setCommonStyle(params: ISetCommonStyleParams, attribute: ICommonStyleParams, offsetX: number, offsetY: number, defaultParams?: ICommonStyleParams | Partial<ICommonStyleParams>[]): void;
package/cjs/react-tree.js CHANGED
@@ -12,10 +12,16 @@ function decodeReactDom(dom) {
12
12
  attribute: attribute
13
13
  }), out = parseToGraphic(g, dom.props, children);
14
14
  return out || (stateProxy && (g.stateProxy = stateProxy), g.id = id, g.name = name,
15
+ parseChildren(children, g), g);
16
+ }
17
+
18
+ function parseChildren(children, g) {
15
19
  (0, vutils_1.isArray)(children) ? children.forEach((item => {
16
- const c = decodeReactDom(item);
17
- c && c.type && g.add(c);
18
- })) : children && g.add(decodeReactDom(children)), g);
20
+ if ((0, vutils_1.isArray)(item)) parseChildren(item, g); else {
21
+ const c = decodeReactDom(item);
22
+ c && c.type && g.add(c);
23
+ }
24
+ })) : children && g.add(decodeReactDom(children));
19
25
  }
20
26
 
21
27
  function parseToGraphic(g, props, childrenList) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/react-tree.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,+BAAgD;AAGhD,SAAgB,cAAc,CAAC,GAAQ;IACrC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;QAEzB,OAAO,GAAG,CAAC;KACZ;IACD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACtB,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,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YACf,GAAG,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;YACxB,MAAM;QACR;YACE,SAAS,GAAG,IAAI,CAAC;KACpB;IAED,IAAI,SAAS,EAAE;QACb,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC7B,MAAM,EAAE,GAAG,6BAAuB,CAAC,CAAC,CAAC,CAAC;YACtC,IAAI,EAAE,EAAE;gBACN,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aACpB;QACH,CAAC,CAAC,CAAC;KACJ;SAAM,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE;QAChC,CAAC,CAAC,SAAS,CAAC,UAAU,GAAG,YAAY;aAClC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;KAChC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","file":"react-tree.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { REACT_TO_CANOPUS_EVENTS } from './jsx';\n\n// temp devode for react jsx customLayout\nexport function decodeReactDom(dom: any) {\n if (!dom || !dom.$$typeof) {\n // not react\n return dom;\n }\n const type = dom.type;\n const { attribute, children, stateProxy, id, name } = dom.props;\n const g = type({ attribute });\n const out = parseToGraphic(g, dom.props, children);\n if (out) {\n return out;\n }\n if (stateProxy) {\n g.stateProxy = stateProxy;\n }\n\n g.id = id;\n g.name = name;\n if (isArray(children)) {\n children.forEach((item: any) => {\n const c = decodeReactDom(item);\n c && c.type && g.add(c);\n });\n } else if (children) {\n g.add(decodeReactDom(children));\n }\n return g;\n}\n\nfunction parseToGraphic(g: any, props: any, childrenList: any): any {\n let isGraphic: boolean = false;\n let out;\n switch (g.type) {\n case 'richtext':\n break;\n case 'rich/text':\n out = g.attribute || {};\n childrenList && (out.text = childrenList);\n g.attribute = out;\n break;\n case 'rich/image':\n out = g.attribute || {};\n break;\n default:\n isGraphic = true;\n }\n\n if (isGraphic) {\n Object.keys(props).forEach(k => {\n const en = REACT_TO_CANOPUS_EVENTS[k];\n if (en) {\n g.on(en, props[k]);\n }\n });\n } else if (g.type === 'richtext') {\n g.attribute.textConfig = childrenList\n .map((item: any) => {\n return decodeReactDom(item);\n })\n .filter((item: any) => item);\n }\n return out;\n}\n"]}
1
+ {"version":3,"sources":["../src/react-tree.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,+BAAgD;AAGhD,SAAgB,cAAc,CAAC,GAAQ;IACrC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;QAEzB,OAAO,GAAG,CAAC;KACZ;IACD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACtB,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC;IAChE,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,cAAc,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACnD,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAC;KACZ;IACD,IAAI,UAAU,EAAE;QACd,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC;KAC3B;IAED,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;IACV,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;IACd,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3B,OAAO,CAAC,CAAC;AACX,CAAC;AApBD,wCAoBC;AAED,SAAS,aAAa,CAAC,QAAa,EAAE,CAAM;IAC1C,IAAI,IAAA,gBAAO,EAAC,QAAQ,CAA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CAAC,CAAC;KACJ;SAAM,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE;QAChC,CAAC,CAAC,SAAS,CAAC,UAAU,GAAG,YAAY;aAClC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;KAChC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","file":"react-tree.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { REACT_TO_CANOPUS_EVENTS } from './jsx';\n\n// temp devode for react jsx customLayout\nexport function decodeReactDom(dom: any) {\n if (!dom || !dom.$$typeof) {\n // not react\n return dom;\n }\n const type = dom.type;\n const { attribute, children, stateProxy, id, name } = dom.props;\n const g = type({ attribute });\n const out = parseToGraphic(g, dom.props, children);\n if (out) {\n return out;\n }\n if (stateProxy) {\n g.stateProxy = stateProxy;\n }\n\n g.id = id;\n g.name = name;\n parseChildren(children, g);\n return g;\n}\n\nfunction parseChildren(children: any, g: any) {\n if (isArray(children)) {\n children.forEach((item: any) => {\n if (isArray(item)) {\n parseChildren(item, g);\n } else {\n const c = decodeReactDom(item);\n c && c.type && g.add(c);\n }\n });\n } else if (children) {\n g.add(decodeReactDom(children));\n }\n}\n\nfunction parseToGraphic(g: any, props: any, childrenList: any): any {\n let isGraphic: boolean = false;\n let out;\n switch (g.type) {\n case 'richtext':\n break;\n case 'rich/text':\n out = g.attribute || {};\n childrenList && (out.text = childrenList);\n g.attribute = out;\n break;\n case 'rich/image':\n out = g.attribute || {};\n break;\n default:\n isGraphic = true;\n }\n\n if (isGraphic) {\n Object.keys(props).forEach(k => {\n const en = REACT_TO_CANOPUS_EVENTS[k];\n if (en) {\n g.on(en, props[k]);\n }\n });\n } else if (g.type === 'richtext') {\n g.attribute.textConfig = childrenList\n .map((item: any) => {\n return decodeReactDom(item);\n })\n .filter((item: any) => item);\n }\n return out;\n}\n"]}
@@ -1 +1,3 @@
1
+
2
+
1
3
  //# sourceMappingURL=render-module.js.map
@@ -174,4 +174,4 @@ vrender_core_1.injectable)(), __metadata("design:paramtypes", []) ], BrowserWind
174
174
  exports.BrowserWindowHandlerContribution = BrowserWindowHandlerContribution, exports.browserWindowModule = new vrender_core_1.ContainerModule((bind => {
175
175
  bind(BrowserWindowHandlerContribution).toSelf(), bind(vrender_core_1.WindowHandlerContribution).toDynamicValue((ctx => ctx.container.get(BrowserWindowHandlerContribution))).whenTargetNamed(BrowserWindowHandlerContribution.env);
176
176
  }));
177
- //# sourceMappingURL=browser-contribution.js.map
177
+ //# sourceMappingURL=browser-contribution.js.map
@@ -162,6 +162,8 @@ export declare class BrowserContext2d implements IContext2d {
162
162
  wrap: boolean;
163
163
  whiteSpace: "normal" | "no-wrap";
164
164
  suffixPosition: "start" | "end" | "middle";
165
+ underlineDash: number[];
166
+ underlineOffset: number;
165
167
  disableAutoClipedPoptip: boolean;
166
168
  };
167
169
  setCommonStyle(params: ISetCommonStyleParams, attribute: ICommonStyleParams, offsetX: number, offsetY: number, defaultParams?: ICommonStyleParams | Partial<ICommonStyleParams>[]): void;
package/es/react-tree.js CHANGED
@@ -8,10 +8,16 @@ export function decodeReactDom(dom) {
8
8
  attribute: attribute
9
9
  }), out = parseToGraphic(g, dom.props, children);
10
10
  return out || (stateProxy && (g.stateProxy = stateProxy), g.id = id, g.name = name,
11
+ parseChildren(children, g), g);
12
+ }
13
+
14
+ function parseChildren(children, g) {
11
15
  isArray(children) ? children.forEach((item => {
12
- const c = decodeReactDom(item);
13
- c && c.type && g.add(c);
14
- })) : children && g.add(decodeReactDom(children)), g);
16
+ if (isArray(item)) parseChildren(item, g); else {
17
+ const c = decodeReactDom(item);
18
+ c && c.type && g.add(c);
19
+ }
20
+ })) : children && g.add(decodeReactDom(children));
15
21
  }
16
22
 
17
23
  function parseToGraphic(g, props, childrenList) {
@@ -1 +1 @@
1
- {"version":3,"sources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,YAAiB;IAC3D,IAAI,SAAS,GAAY,KAAK,CAAC;IAC/B,IAAI,GAAG,CAAC;IACR,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,UAAU;YACb,MAAM;QACR,KAAK,WAAW;YACd,GAAG,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;YACxB,YAAY,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,YAAY,CAAC,CAAC;YAC1C,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC;YAClB,MAAM;QACR,KAAK,YAAY;YACf,GAAG,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;YACxB,MAAM;QACR;YACE,SAAS,GAAG,IAAI,CAAC;KACpB;IAED,IAAI,SAAS,EAAE;QACb,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC7B,MAAM,EAAE,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;YACtC,IAAI,EAAE,EAAE;gBACN,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aACpB;QACH,CAAC,CAAC,CAAC;KACJ;SAAM,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE;QAChC,CAAC,CAAC,SAAS,CAAC,UAAU,GAAG,YAAY;aAClC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;KAChC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","file":"react-tree.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { REACT_TO_CANOPUS_EVENTS } from './jsx';\n\n// temp devode for react jsx customLayout\nexport function decodeReactDom(dom: any) {\n if (!dom || !dom.$$typeof) {\n // not react\n return dom;\n }\n const type = dom.type;\n const { attribute, children, stateProxy, id, name } = dom.props;\n const g = type({ attribute });\n const out = parseToGraphic(g, dom.props, children);\n if (out) {\n return out;\n }\n if (stateProxy) {\n g.stateProxy = stateProxy;\n }\n\n g.id = id;\n g.name = name;\n if (isArray(children)) {\n children.forEach((item: any) => {\n const c = decodeReactDom(item);\n c && c.type && g.add(c);\n });\n } else if (children) {\n g.add(decodeReactDom(children));\n }\n return g;\n}\n\nfunction parseToGraphic(g: any, props: any, childrenList: any): any {\n let isGraphic: boolean = false;\n let out;\n switch (g.type) {\n case 'richtext':\n break;\n case 'rich/text':\n out = g.attribute || {};\n childrenList && (out.text = childrenList);\n g.attribute = out;\n break;\n case 'rich/image':\n out = g.attribute || {};\n break;\n default:\n isGraphic = true;\n }\n\n if (isGraphic) {\n Object.keys(props).forEach(k => {\n const en = REACT_TO_CANOPUS_EVENTS[k];\n if (en) {\n g.on(en, props[k]);\n }\n });\n } else if (g.type === 'richtext') {\n g.attribute.textConfig = childrenList\n .map((item: any) => {\n return decodeReactDom(item);\n })\n .filter((item: any) => item);\n }\n return out;\n}\n"]}
1
+ {"version":3,"sources":["../src/react-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAGhD,MAAM,UAAU,cAAc,CAAC,GAAQ;IACrC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;QAEzB,OAAO,GAAG,CAAC;KACZ;IACD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACtB,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC;IAChE,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,cAAc,CAAC,CAAC,EAAE,GAAG,CAAC,KA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,YAAY;YACf,GAAG,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;YACxB,MAAM;QACR;YACE,SAAS,GAAG,IAAI,CAAC;KACpB;IAED,IAAI,SAAS,EAAE;QACb,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC7B,MAAM,EAAE,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;YACtC,IAAI,EAAE,EAAE;gBACN,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aACpB;QACH,CAAC,CAAC,CAAC;KACJ;SAAM,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE;QAChC,CAAC,CAAC,SAAS,CAAC,UAAU,GAAG,YAAY;aAClC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;KAChC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","file":"react-tree.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { REACT_TO_CANOPUS_EVENTS } from './jsx';\n\n// temp devode for react jsx customLayout\nexport function decodeReactDom(dom: any) {\n if (!dom || !dom.$$typeof) {\n // not react\n return dom;\n }\n const type = dom.type;\n const { attribute, children, stateProxy, id, name } = dom.props;\n const g = type({ attribute });\n const out = parseToGraphic(g, dom.props, children);\n if (out) {\n return out;\n }\n if (stateProxy) {\n g.stateProxy = stateProxy;\n }\n\n g.id = id;\n g.name = name;\n parseChildren(children, g);\n return g;\n}\n\nfunction parseChildren(children: any, g: any) {\n if (isArray(children)) {\n children.forEach((item: any) => {\n if (isArray(item)) {\n parseChildren(item, g);\n } else {\n const c = decodeReactDom(item);\n c && c.type && g.add(c);\n }\n });\n } else if (children) {\n g.add(decodeReactDom(children));\n }\n}\n\nfunction parseToGraphic(g: any, props: any, childrenList: any): any {\n let isGraphic: boolean = false;\n let out;\n switch (g.type) {\n case 'richtext':\n break;\n case 'rich/text':\n out = g.attribute || {};\n childrenList && (out.text = childrenList);\n g.attribute = out;\n break;\n case 'rich/image':\n out = g.attribute || {};\n break;\n default:\n isGraphic = true;\n }\n\n if (isGraphic) {\n Object.keys(props).forEach(k => {\n const en = REACT_TO_CANOPUS_EVENTS[k];\n if (en) {\n g.on(en, props[k]);\n }\n });\n } else if (g.type === 'richtext') {\n g.attribute.textConfig = childrenList\n .map((item: any) => {\n return decodeReactDom(item);\n })\n .filter((item: any) => item);\n }\n return out;\n}\n"]}
@@ -1 +1,3 @@
1
+
2
+
1
3
  //# sourceMappingURL=render-module.js.map
@@ -172,4 +172,4 @@ export { BrowserWindowHandlerContribution };
172
172
  export const browserWindowModule = new ContainerModule((bind => {
173
173
  bind(BrowserWindowHandlerContribution).toSelf(), bind(WindowHandlerContribution).toDynamicValue((ctx => ctx.container.get(BrowserWindowHandlerContribution))).whenTargetNamed(BrowserWindowHandlerContribution.env);
174
174
  }));
175
- //# sourceMappingURL=browser-contribution.js.map
175
+ //# sourceMappingURL=browser-contribution.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-kits",
3
- "version": "0.17.25",
3
+ "version": "0.17.26-alpha.1",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "main": "cjs/index.js",
@@ -12,8 +12,8 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@visactor/vrender-core": "0.17.25",
16
- "@visactor/vutils": "~0.17.3",
15
+ "@visactor/vrender-core": "0.17.26-alpha.1",
16
+ "@visactor/vutils": "~0.18.1",
17
17
  "@resvg/resvg-js": "2.4.1",
18
18
  "roughjs": "4.5.2"
19
19
  },