@retikz/core 0.1.0-rc.1 → 0.1.0-rc.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/compile/compile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAkB,MAAM,cAAc,CAAC;AAK1D,OAAO,EAAE,KAAK,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAuBrE,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,IAAI,EACA,2BAA2B,GAC3B,gBAAgB,GAChB,0BAA0B,GAC1B,wBAAwB,GACxB,yBAAyB,GACzB,sBAAsB,GACtB,8BAA8B,GAC9B,oBAAoB,GACpB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAClB,iBAAiB;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,2BAA2B;AAC3B,MAAM,MAAM,cAAc,GAAG;IAC3B,oCAAoC;IACpC,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC5C,CAAC;AAWF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,IAAI,EAAE,EAAE,UAAS,cAAmB,KAAG,
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/compile/compile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAkB,MAAM,cAAc,CAAC;AAK1D,OAAO,EAAE,KAAK,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAuBrE,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,IAAI,EACA,2BAA2B,GAC3B,gBAAgB,GAChB,0BAA0B,GAC1B,wBAAwB,GACxB,yBAAyB,GACzB,sBAAsB,GACtB,8BAA8B,GAC9B,oBAAoB,GACpB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAClB,iBAAiB;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,2BAA2B;AAC3B,MAAM,MAAM,cAAc,GAAG;IAC3B,oCAAoC;IACpC,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC5C,CAAC;AAWF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,IAAI,EAAE,EAAE,UAAS,cAAmB,KAAG,KAwErE,CAAC"}
|
|
@@ -49,13 +49,13 @@ var compileToScene = (ir, options = {}) => {
|
|
|
49
49
|
const primitives = [];
|
|
50
50
|
const nodeIndex = /* @__PURE__ */ new Map();
|
|
51
51
|
const allPoints = [];
|
|
52
|
+
const nodeLayouts = /* @__PURE__ */ new Map();
|
|
52
53
|
for (let i = 0; i < ir.children.length; i++) {
|
|
53
54
|
const child = ir.children[i];
|
|
54
55
|
if (child.type === "node") {
|
|
55
56
|
const layout = layoutNode(child, measureText, nodeIndex, nodeDistance);
|
|
56
57
|
if (child.id) nodeIndex.set(child.id, layout);
|
|
57
|
-
|
|
58
|
-
allPoints.push(rect.anchor(layout.rect, "north-west"), rect.anchor(layout.rect, "north-east"), rect.anchor(layout.rect, "south-west"), rect.anchor(layout.rect, "south-east"));
|
|
58
|
+
nodeLayouts.set(i, layout);
|
|
59
59
|
} else if (child.type === "coordinate") {
|
|
60
60
|
const center = resolvePosition(child.position, nodeIndex, nodeDistance);
|
|
61
61
|
if (!center) {
|
|
@@ -71,7 +71,12 @@ var compileToScene = (ir, options = {}) => {
|
|
|
71
71
|
}
|
|
72
72
|
for (let i = 0; i < ir.children.length; i++) {
|
|
73
73
|
const child = ir.children[i];
|
|
74
|
-
if (child.type === "
|
|
74
|
+
if (child.type === "node") {
|
|
75
|
+
const layout = nodeLayouts.get(i);
|
|
76
|
+
if (!layout) continue;
|
|
77
|
+
for (const prim of emitNodePrimitives(layout, round)) primitives.push(prim);
|
|
78
|
+
allPoints.push(rect.anchor(layout.rect, "north-west"), rect.anchor(layout.rect, "north-east"), rect.anchor(layout.rect, "south-west"), rect.anchor(layout.rect, "south-east"));
|
|
79
|
+
} else if (child.type === "path") {
|
|
75
80
|
const result = emitPathPrimitive(child, nodeIndex, round, measureText, {
|
|
76
81
|
onWarn,
|
|
77
82
|
irPath: `children[${i}].path`
|
|
@@ -49,13 +49,13 @@ var compileToScene = (ir, options = {}) => {
|
|
|
49
49
|
const primitives = [];
|
|
50
50
|
const nodeIndex = /* @__PURE__ */ new Map();
|
|
51
51
|
const allPoints = [];
|
|
52
|
+
const nodeLayouts = /* @__PURE__ */ new Map();
|
|
52
53
|
for (let i = 0; i < ir.children.length; i++) {
|
|
53
54
|
const child = ir.children[i];
|
|
54
55
|
if (child.type === "node") {
|
|
55
56
|
const layout = require_node.layoutNode(child, measureText, nodeIndex, nodeDistance);
|
|
56
57
|
if (child.id) nodeIndex.set(child.id, layout);
|
|
57
|
-
|
|
58
|
-
allPoints.push(require_rect.rect.anchor(layout.rect, "north-west"), require_rect.rect.anchor(layout.rect, "north-east"), require_rect.rect.anchor(layout.rect, "south-west"), require_rect.rect.anchor(layout.rect, "south-east"));
|
|
58
|
+
nodeLayouts.set(i, layout);
|
|
59
59
|
} else if (child.type === "coordinate") {
|
|
60
60
|
const center = require_position.resolvePosition(child.position, nodeIndex, nodeDistance);
|
|
61
61
|
if (!center) {
|
|
@@ -71,7 +71,12 @@ var compileToScene = (ir, options = {}) => {
|
|
|
71
71
|
}
|
|
72
72
|
for (let i = 0; i < ir.children.length; i++) {
|
|
73
73
|
const child = ir.children[i];
|
|
74
|
-
if (child.type === "
|
|
74
|
+
if (child.type === "node") {
|
|
75
|
+
const layout = nodeLayouts.get(i);
|
|
76
|
+
if (!layout) continue;
|
|
77
|
+
for (const prim of require_node.emitNodePrimitives(layout, round)) primitives.push(prim);
|
|
78
|
+
allPoints.push(require_rect.rect.anchor(layout.rect, "north-west"), require_rect.rect.anchor(layout.rect, "north-east"), require_rect.rect.anchor(layout.rect, "south-west"), require_rect.rect.anchor(layout.rect, "south-east"));
|
|
79
|
+
} else if (child.type === "path") {
|
|
75
80
|
const result = require_index.emitPathPrimitive(child, nodeIndex, round, measureText, {
|
|
76
81
|
onWarn,
|
|
77
82
|
irPath: `children[${i}].path`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/compile/compile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAkB,MAAM,cAAc,CAAC;AAK1D,OAAO,EAAE,KAAK,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAuBrE,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,IAAI,EACA,2BAA2B,GAC3B,gBAAgB,GAChB,0BAA0B,GAC1B,wBAAwB,GACxB,yBAAyB,GACzB,sBAAsB,GACtB,8B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