ooxml-core 0.7.0 → 0.9.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 (48) hide show
  1. package/README.md +7 -0
  2. package/dist/chart/blank-display.d.ts +37 -0
  3. package/dist/chart/blank-display.d.ts.map +1 -0
  4. package/dist/chart/box-stats.d.ts +28 -0
  5. package/dist/chart/box-stats.d.ts.map +1 -0
  6. package/dist/chart/index.cjs +229 -0
  7. package/dist/chart/index.d.ts +6 -0
  8. package/dist/chart/index.d.ts.map +1 -0
  9. package/dist/chart/index.mjs +220 -0
  10. package/dist/chart/regression.d.ts +40 -0
  11. package/dist/chart/regression.d.ts.map +1 -0
  12. package/dist/chart/stacked-series.d.ts +39 -0
  13. package/dist/chart/stacked-series.d.ts.map +1 -0
  14. package/dist/docx/embedded.cjs +23 -2
  15. package/dist/docx/embedded.mjs +23 -2
  16. package/dist/docx/index.cjs +23 -2
  17. package/dist/docx/index.mjs +23 -2
  18. package/dist/docx/layout/index.cjs +2 -0
  19. package/dist/docx/layout/index.mjs +2 -0
  20. package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
  21. package/dist/docx/layout/result.d.ts +3 -0
  22. package/dist/docx/layout/result.d.ts.map +1 -1
  23. package/dist/docx/load/index.cjs +23 -2
  24. package/dist/docx/load/index.mjs +23 -2
  25. package/dist/docx/write-table-properties.d.ts +2 -0
  26. package/dist/docx/write-table-properties.d.ts.map +1 -1
  27. package/dist/docx/write-table.d.ts.map +1 -1
  28. package/dist/geometry/index.cjs +192 -0
  29. package/dist/geometry/index.d.ts +1 -0
  30. package/dist/geometry/index.d.ts.map +1 -1
  31. package/dist/geometry/index.mjs +192 -1
  32. package/dist/geometry/svg-path-curves.d.ts +11 -0
  33. package/dist/geometry/svg-path-curves.d.ts.map +1 -0
  34. package/dist/geometry/svg-path-flatten.d.ts +26 -0
  35. package/dist/geometry/svg-path-flatten.d.ts.map +1 -0
  36. package/dist/geometry/svg-path-types.d.ts +6 -0
  37. package/dist/geometry/svg-path-types.d.ts.map +1 -0
  38. package/dist/index.cjs +554 -3
  39. package/dist/index.d.ts +2 -0
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.mjs +553 -4
  42. package/dist/text/index.cjs +122 -0
  43. package/dist/text/index.d.ts +3 -0
  44. package/dist/text/index.d.ts.map +1 -0
  45. package/dist/text/index.mjs +117 -0
  46. package/dist/text/unicode-script-detection.d.ts +54 -0
  47. package/dist/text/unicode-script-detection.d.ts.map +1 -0
  48. package/package.json +11 -1
@@ -14894,4 +14894,195 @@ function subtractSvgPaths(path1, path2) {
14894
14894
  return subtractShapes(path1, path2);
14895
14895
  }
14896
14896
 
14897
- export { ACTION_BUTTON_CONNECTION_SITES, ACTION_BUTTON_PRESET_DEFINITIONS, ACTION_BUTTON_TEXT_RECTS, ANGLE_SCALE, ARROW_CALLOUT_CONNECTION_SITES, ARROW_CALLOUT_PRESET_DEFINITIONS, ARROW_CONNECTION_SITES, ARROW_PRESET_DEFINITIONS, ARROW_TEXT_RECTS, BASIC_SHAPE_CONNECTION_SITES_A, BASIC_SHAPE_CONNECTION_SITES_B, BRACE_CONNECTION_SITES, BRACE_TEXT_RECTS, CALLOUT_CONNECTION_SITES, CALLOUT_TEXT_RECTS, CARDINAL_SITES, CHART_MARK_PRESET_DEFINITIONS, CIRCULAR_ARROW_CONNECTION_SITES, CIRCULAR_ARROW_TEXT_RECTS, CLIP_PATHS_CORE, CLIP_PATHS_EXTENDED, CLOUD_CALLOUT_PRESET_DEFINITIONS, CLOUD_CALLOUT_TAIL_COUNT, CLOUD_LOBE_COUNT, COM_AVLST_GROUND_TRUTH, CONNECTORS_BRACKETS_PRESET_DEFINITIONS, CURVED_ARROWS_CONNECTORS_PRESET_DEFINITIONS, CURVED_ARROW_CONNECTION_SITES, EPSILON, EXACT_CURVED_ARROW_PRESET_DEFINITIONS, EXTENDED_SHAPE_DEFINITIONS, FLOWCHART_CONNECTION_SITES, FLOWCHART_PRESET_DEFINITIONS, FLOWCHART_TEXT_RECTS, GEAR9_CONNECTION_SITES, LEFT_CIRCULAR_ARROW_CONNECTION_SITES, LEFT_RIGHT_CIRCULAR_ARROW_CONNECTION_SITES, MATH_SYMBOL_CONNECTION_SITES, MISC_ARROW_CONNECTION_SITES, MISC_PRESET_DEFINITIONS, MISC_SHAPE_CONNECTION_SITES, MISC_TEXT_RECTS_A, MISC_TEXT_RECTS_B, POLYGON_CONNECTION_SITES, POLYGON_TEXT_RECTS, PRESET_GEOMETRY_ALIASES, PRESET_SHAPE_CATEGORY_LABELS, PRESET_SHAPE_CLIP_PATHS, PRESET_SHAPE_DEFINITIONS, PRESET_SHAPE_GEOMETRY_TABLE, PRIMARY_SHAPE_DEFINITIONS, QUAD_CONNECTION_SITES, QUAD_TEXT_RECTS, RECTS_SNIPS_PRESET_DEFINITIONS, RECT_VARIANT_CONNECTION_SITES, REFINED_ARROW_PRESET_DEFINITIONS, RIBBON_CONNECTION_SITES, RIBBON_TEXT_RECTS, SCROLLS_ACCENT_CALLOUTS_PRESET_DEFINITIONS, STAR_CONNECTION_SITES, STAR_TEXT_RECTS, ST_SHAPE_TYPE_VALUES, TABS_DECORATIONS_PRESET_DEFINITIONS, TAB_CONNECTION_SITES, TAB_TEXT_RECTS, _internalForTests, angleToRadians, at, buildCalloutLeaderLineSvgPath, clipPolygons, combineShapes, computeUnionWalk, convexHull, createBuiltinVariables, cross2, cxn, dedupPoly, elbowCurveSegments, elbowWaypoints, ensureCCW, ensureCW, evaluateFormula, evaluateGuides, findAllIntersections, fmtNum, fragmentShapes, gd, gear6, gear9, getAdjustmentAwareClipPath, getCalloutLeaderLineGeometry, getCalloutTier, getCalloutViewBoxBounds, getCloudCalloutClipPath, getCloudClipPath, getPresetConnectionSites, getPresetShapeClipPath, getPresetTextRect, insertIntersections, intersectPolygons, intersectShapes, intersectSvgPaths, isCalloutShape, isConvex, isHorizontalPrimaryAxis, isStShapeType, lineIntersection, lookupPresetConnectionSites, lookupPresetTextRectOverride, mergeOverlappingPolygons, mergeShapes, normalizeStShapeType, parseAdjustmentValues, parseFormula, parseGuideDefinitions, pointInPolygon, pointInTriangle, polygonArea, polygonsToSvgPath, resolveCoordinate, resolveOperand, segmentIntersection, signedArea, subtractPolygons, subtractShapes, subtractSvgPaths, sutherlandHodgman, svgPathToPolygons, triangulate, unionPolygons, unionShapes, unionSvgPaths, vec2Eq };
14897
+ // src/geometry/svg-path-curves.ts
14898
+ function sampleCubic(p0, p1, p2, p3, segments, out) {
14899
+ for (let i = 1; i <= segments; i++) {
14900
+ const t = i / segments;
14901
+ const mt = 1 - t;
14902
+ const x = mt * mt * mt * p0.x + 3 * mt * mt * t * p1.x + 3 * mt * t * t * p2.x + t * t * t * p3.x;
14903
+ const y = mt * mt * mt * p0.y + 3 * mt * mt * t * p1.y + 3 * mt * t * t * p2.y + t * t * t * p3.y;
14904
+ out.push({ x, y });
14905
+ }
14906
+ }
14907
+ function sampleQuadratic(p0, p1, p2, segments, out) {
14908
+ for (let i = 1; i <= segments; i++) {
14909
+ const t = i / segments;
14910
+ const mt = 1 - t;
14911
+ const x = mt * mt * p0.x + 2 * mt * t * p1.x + t * t * p2.x;
14912
+ const y = mt * mt * p0.y + 2 * mt * t * p1.y + t * t * p2.y;
14913
+ out.push({ x, y });
14914
+ }
14915
+ }
14916
+ function sampleArc(start, rxIn, ryIn, xAxisRotationDeg, largeArcFlag, sweepFlag, end, segments, out) {
14917
+ if (rxIn === 0 || ryIn === 0 || start.x === end.x && start.y === end.y) {
14918
+ out.push(end);
14919
+ return;
14920
+ }
14921
+ const phi = xAxisRotationDeg * Math.PI / 180;
14922
+ const cosPhi = Math.cos(phi);
14923
+ const sinPhi = Math.sin(phi);
14924
+ let rx = Math.abs(rxIn);
14925
+ let ry = Math.abs(ryIn);
14926
+ const dx2 = (start.x - end.x) / 2;
14927
+ const dy2 = (start.y - end.y) / 2;
14928
+ const x1p = cosPhi * dx2 + sinPhi * dy2;
14929
+ const y1p = -sinPhi * dx2 + cosPhi * dy2;
14930
+ const lambda = x1p * x1p / (rx * rx) + y1p * y1p / (ry * ry);
14931
+ if (lambda > 1) {
14932
+ const scale = Math.sqrt(lambda);
14933
+ rx *= scale;
14934
+ ry *= scale;
14935
+ }
14936
+ const sign = largeArcFlag !== sweepFlag ? 1 : -1;
14937
+ const num = rx * rx * ry * ry - rx * rx * y1p * y1p - ry * ry * x1p * x1p;
14938
+ const den = rx * rx * y1p * y1p + ry * ry * x1p * x1p;
14939
+ const coef = sign * Math.sqrt(Math.max(0, num / den));
14940
+ const cxp = coef * (rx * y1p) / ry;
14941
+ const cyp = coef * -(ry * x1p) / rx;
14942
+ const cx = cosPhi * cxp - sinPhi * cyp + (start.x + end.x) / 2;
14943
+ const cy = sinPhi * cxp + cosPhi * cyp + (start.y + end.y) / 2;
14944
+ const angle = (ux, uy, vx, vy) => {
14945
+ const sign2 = ux * vy - uy * vx < 0 ? -1 : 1;
14946
+ const dot = Math.max(
14947
+ -1,
14948
+ Math.min(1, (ux * vx + uy * vy) / (Math.hypot(ux, uy) * Math.hypot(vx, vy)))
14949
+ );
14950
+ return sign2 * Math.acos(dot);
14951
+ };
14952
+ const theta1 = angle(1, 0, (x1p - cxp) / rx, (y1p - cyp) / ry);
14953
+ let deltaTheta = angle((x1p - cxp) / rx, (y1p - cyp) / ry, (-x1p - cxp) / rx, (-y1p - cyp) / ry);
14954
+ if (!sweepFlag && deltaTheta > 0) {
14955
+ deltaTheta -= 2 * Math.PI;
14956
+ } else if (sweepFlag && deltaTheta < 0) {
14957
+ deltaTheta += 2 * Math.PI;
14958
+ }
14959
+ const steps = Math.max(2, Math.round(segments * (Math.abs(deltaTheta) / (Math.PI / 2))));
14960
+ for (let i = 1; i <= steps; i++) {
14961
+ const theta = theta1 + deltaTheta * i / steps;
14962
+ const x = cx + rx * Math.cos(theta) * cosPhi - ry * Math.sin(theta) * sinPhi;
14963
+ const y = cy + rx * Math.cos(theta) * sinPhi + ry * Math.sin(theta) * cosPhi;
14964
+ out.push({ x, y });
14965
+ }
14966
+ }
14967
+
14968
+ // src/geometry/svg-path-flatten.ts
14969
+ var COMMAND_RE = /[MLCQZAHVSmlcqzahvs][^MLCQZAHVSmlcqzahvs]*/gu;
14970
+ var NUMBER_RE = /-?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/gu;
14971
+ function tokenize(d) {
14972
+ const tokens = [];
14973
+ const matches = d.match(COMMAND_RE);
14974
+ if (!matches) {
14975
+ return tokens;
14976
+ }
14977
+ for (const raw of matches) {
14978
+ const type = raw.charAt(0);
14979
+ const nums = raw.slice(1).match(NUMBER_RE);
14980
+ tokens.push({ type, values: nums ? nums.map((n) => Number.parseFloat(n)) : [] });
14981
+ }
14982
+ return tokens;
14983
+ }
14984
+ function flattenSvgPath(d, curveSegments = 16) {
14985
+ if (!Number.isFinite(curveSegments) || curveSegments < 1) curveSegments = 16;
14986
+ curveSegments = Math.min(4096, Math.floor(curveSegments));
14987
+ const tokens = tokenize(d);
14988
+ const loops = [];
14989
+ let current = [];
14990
+ let cursor = { x: 0, y: 0 };
14991
+ let subpathStart = { x: 0, y: 0 };
14992
+ let lastControl;
14993
+ let lastCommand = "";
14994
+ const closeLoop = () => {
14995
+ if (current.length > 0) {
14996
+ loops.push(current);
14997
+ }
14998
+ current = [];
14999
+ };
15000
+ for (const token of tokens) {
15001
+ const type = token.type;
15002
+ const upper = type.toUpperCase();
15003
+ const relative = type !== upper;
15004
+ const v = token.values;
15005
+ if (v.some((value) => !Number.isFinite(value)) || upper === "M" && v.length < 2) continue;
15006
+ if (upper === "M") {
15007
+ closeLoop();
15008
+ const x = relative ? cursor.x + at(v, 0) : at(v, 0);
15009
+ const y = relative ? cursor.y + at(v, 1) : at(v, 1);
15010
+ cursor = { x, y };
15011
+ subpathStart = cursor;
15012
+ current.push(cursor);
15013
+ for (let i = 2; i + 1 < v.length; i += 2) {
15014
+ const lx = relative ? cursor.x + at(v, i) : at(v, i);
15015
+ const ly = relative ? cursor.y + at(v, i + 1) : at(v, i + 1);
15016
+ cursor = { x: lx, y: ly };
15017
+ current.push(cursor);
15018
+ }
15019
+ } else if (upper === "L") {
15020
+ for (let i = 0; i + 1 < v.length; i += 2) {
15021
+ const x = relative ? cursor.x + at(v, i) : at(v, i);
15022
+ const y = relative ? cursor.y + at(v, i + 1) : at(v, i + 1);
15023
+ cursor = { x, y };
15024
+ current.push(cursor);
15025
+ }
15026
+ } else if (upper === "H") {
15027
+ for (const value of v) {
15028
+ const x = relative ? cursor.x + value : value;
15029
+ cursor = { x, y: cursor.y };
15030
+ current.push(cursor);
15031
+ }
15032
+ } else if (upper === "V") {
15033
+ for (const value of v) {
15034
+ const y = relative ? cursor.y + value : value;
15035
+ cursor = { x: cursor.x, y };
15036
+ current.push(cursor);
15037
+ }
15038
+ } else if (upper === "C") {
15039
+ for (let i = 0; i + 5 < v.length; i += 6) {
15040
+ const p1 = relative ? { x: cursor.x + at(v, i), y: cursor.y + at(v, i + 1) } : { x: at(v, i), y: at(v, i + 1) };
15041
+ const p2 = relative ? { x: cursor.x + at(v, i + 2), y: cursor.y + at(v, i + 3) } : { x: at(v, i + 2), y: at(v, i + 3) };
15042
+ const p3 = relative ? { x: cursor.x + at(v, i + 4), y: cursor.y + at(v, i + 5) } : { x: at(v, i + 4), y: at(v, i + 5) };
15043
+ sampleCubic(cursor, p1, p2, p3, curveSegments, current);
15044
+ cursor = p3;
15045
+ lastControl = p2;
15046
+ }
15047
+ } else if (upper === "S") {
15048
+ for (let i = 0; i + 3 < v.length; i += 4) {
15049
+ const p1 = lastCommand === "C" || lastCommand === "S" ? {
15050
+ x: 2 * cursor.x - (lastControl?.x ?? cursor.x),
15051
+ y: 2 * cursor.y - (lastControl?.y ?? cursor.y)
15052
+ } : cursor;
15053
+ const p2 = relative ? { x: cursor.x + at(v, i), y: cursor.y + at(v, i + 1) } : { x: at(v, i), y: at(v, i + 1) };
15054
+ const p3 = relative ? { x: cursor.x + at(v, i + 2), y: cursor.y + at(v, i + 3) } : { x: at(v, i + 2), y: at(v, i + 3) };
15055
+ sampleCubic(cursor, p1, p2, p3, curveSegments, current);
15056
+ cursor = p3;
15057
+ lastControl = p2;
15058
+ }
15059
+ } else if (upper === "Q") {
15060
+ for (let i = 0; i + 3 < v.length; i += 4) {
15061
+ const p1 = relative ? { x: cursor.x + at(v, i), y: cursor.y + at(v, i + 1) } : { x: at(v, i), y: at(v, i + 1) };
15062
+ const p2 = relative ? { x: cursor.x + at(v, i + 2), y: cursor.y + at(v, i + 3) } : { x: at(v, i + 2), y: at(v, i + 3) };
15063
+ sampleQuadratic(cursor, p1, p2, curveSegments, current);
15064
+ cursor = p2;
15065
+ lastControl = p1;
15066
+ }
15067
+ } else if (upper === "A") {
15068
+ for (let i = 0; i + 6 < v.length; i += 7) {
15069
+ const rx = at(v, i);
15070
+ const ry = at(v, i + 1);
15071
+ const rot = at(v, i + 2);
15072
+ const largeArc = at(v, i + 3) !== 0;
15073
+ const sweep = at(v, i + 4) !== 0;
15074
+ const end = relative ? { x: cursor.x + at(v, i + 5), y: cursor.y + at(v, i + 6) } : { x: at(v, i + 5), y: at(v, i + 6) };
15075
+ sampleArc(cursor, rx, ry, rot, largeArc, sweep, end, curveSegments, current);
15076
+ cursor = end;
15077
+ }
15078
+ } else if (upper === "Z") {
15079
+ cursor = subpathStart;
15080
+ current.push(cursor);
15081
+ }
15082
+ lastCommand = upper;
15083
+ }
15084
+ closeLoop();
15085
+ return loops;
15086
+ }
15087
+
15088
+ export { ACTION_BUTTON_CONNECTION_SITES, ACTION_BUTTON_PRESET_DEFINITIONS, ACTION_BUTTON_TEXT_RECTS, ANGLE_SCALE, ARROW_CALLOUT_CONNECTION_SITES, ARROW_CALLOUT_PRESET_DEFINITIONS, ARROW_CONNECTION_SITES, ARROW_PRESET_DEFINITIONS, ARROW_TEXT_RECTS, BASIC_SHAPE_CONNECTION_SITES_A, BASIC_SHAPE_CONNECTION_SITES_B, BRACE_CONNECTION_SITES, BRACE_TEXT_RECTS, CALLOUT_CONNECTION_SITES, CALLOUT_TEXT_RECTS, CARDINAL_SITES, CHART_MARK_PRESET_DEFINITIONS, CIRCULAR_ARROW_CONNECTION_SITES, CIRCULAR_ARROW_TEXT_RECTS, CLIP_PATHS_CORE, CLIP_PATHS_EXTENDED, CLOUD_CALLOUT_PRESET_DEFINITIONS, CLOUD_CALLOUT_TAIL_COUNT, CLOUD_LOBE_COUNT, COM_AVLST_GROUND_TRUTH, CONNECTORS_BRACKETS_PRESET_DEFINITIONS, CURVED_ARROWS_CONNECTORS_PRESET_DEFINITIONS, CURVED_ARROW_CONNECTION_SITES, EPSILON, EXACT_CURVED_ARROW_PRESET_DEFINITIONS, EXTENDED_SHAPE_DEFINITIONS, FLOWCHART_CONNECTION_SITES, FLOWCHART_PRESET_DEFINITIONS, FLOWCHART_TEXT_RECTS, GEAR9_CONNECTION_SITES, LEFT_CIRCULAR_ARROW_CONNECTION_SITES, LEFT_RIGHT_CIRCULAR_ARROW_CONNECTION_SITES, MATH_SYMBOL_CONNECTION_SITES, MISC_ARROW_CONNECTION_SITES, MISC_PRESET_DEFINITIONS, MISC_SHAPE_CONNECTION_SITES, MISC_TEXT_RECTS_A, MISC_TEXT_RECTS_B, POLYGON_CONNECTION_SITES, POLYGON_TEXT_RECTS, PRESET_GEOMETRY_ALIASES, PRESET_SHAPE_CATEGORY_LABELS, PRESET_SHAPE_CLIP_PATHS, PRESET_SHAPE_DEFINITIONS, PRESET_SHAPE_GEOMETRY_TABLE, PRIMARY_SHAPE_DEFINITIONS, QUAD_CONNECTION_SITES, QUAD_TEXT_RECTS, RECTS_SNIPS_PRESET_DEFINITIONS, RECT_VARIANT_CONNECTION_SITES, REFINED_ARROW_PRESET_DEFINITIONS, RIBBON_CONNECTION_SITES, RIBBON_TEXT_RECTS, SCROLLS_ACCENT_CALLOUTS_PRESET_DEFINITIONS, STAR_CONNECTION_SITES, STAR_TEXT_RECTS, ST_SHAPE_TYPE_VALUES, TABS_DECORATIONS_PRESET_DEFINITIONS, TAB_CONNECTION_SITES, TAB_TEXT_RECTS, _internalForTests, angleToRadians, at, buildCalloutLeaderLineSvgPath, clipPolygons, combineShapes, computeUnionWalk, convexHull, createBuiltinVariables, cross2, cxn, dedupPoly, elbowCurveSegments, elbowWaypoints, ensureCCW, ensureCW, evaluateFormula, evaluateGuides, findAllIntersections, flattenSvgPath, fmtNum, fragmentShapes, gd, gear6, gear9, getAdjustmentAwareClipPath, getCalloutLeaderLineGeometry, getCalloutTier, getCalloutViewBoxBounds, getCloudCalloutClipPath, getCloudClipPath, getPresetConnectionSites, getPresetShapeClipPath, getPresetTextRect, insertIntersections, intersectPolygons, intersectShapes, intersectSvgPaths, isCalloutShape, isConvex, isHorizontalPrimaryAxis, isStShapeType, lineIntersection, lookupPresetConnectionSites, lookupPresetTextRectOverride, mergeOverlappingPolygons, mergeShapes, normalizeStShapeType, parseAdjustmentValues, parseFormula, parseGuideDefinitions, pointInPolygon, pointInTriangle, polygonArea, polygonsToSvgPath, resolveCoordinate, resolveOperand, segmentIntersection, signedArea, subtractPolygons, subtractShapes, subtractSvgPaths, sutherlandHodgman, svgPathToPolygons, triangulate, unionPolygons, unionShapes, unionSvgPaths, vec2Eq };
@@ -0,0 +1,11 @@
1
+ import type { Point2 } from './svg-path-types.js';
2
+ /** Sample a cubic Bezier at `segments` steps (excluding the start point). */
3
+ export declare function sampleCubic(p0: Point2, p1: Point2, p2: Point2, p3: Point2, segments: number, out: Point2[]): void;
4
+ /** Sample a quadratic Bezier at `segments` steps (excluding the start point). */
5
+ export declare function sampleQuadratic(p0: Point2, p1: Point2, p2: Point2, segments: number, out: Point2[]): void;
6
+ /**
7
+ * Sample an SVG elliptical arc (endpoint parameterization, SVG spec F.6) into
8
+ * points, appended to `out`. Excludes the start point.
9
+ */
10
+ export declare function sampleArc(start: Point2, rxIn: number, ryIn: number, xAxisRotationDeg: number, largeArcFlag: boolean, sweepFlag: boolean, end: Point2, segments: number, out: Point2[]): void;
11
+ //# sourceMappingURL=svg-path-curves.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg-path-curves.d.ts","sourceRoot":"","sources":["../../src/geometry/svg-path-curves.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,6EAA6E;AAC7E,wBAAgB,WAAW,CAC1B,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EAAE,GACX,IAAI,CAUN;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAC9B,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EAAE,GACX,IAAI,CAQN;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACxB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,MAAM,EACxB,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EAAE,GACX,IAAI,CAyDN"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Flatten an SVG path `d` string into closed polygon loops (2D points), for
3
+ * consumers that need a concrete outline rather than curve primitives (the
4
+ * three.js SmartArt renderer extrudes/fills a shape's outline as a flat
5
+ * polygon; sampling curves here keeps that consumer three.js-agnostic and
6
+ * pure/testable).
7
+ *
8
+ * Supports M/L/H/V/C/Q/S/A/Z, both absolute and relative variants, and
9
+ * multiple subpaths (each additional `M` starts a new loop; the first loop is
10
+ * the outer boundary, subsequent loops are holes - the same convention as
11
+ * `THREE.Shape`/`THREE.Path`.holes).
12
+ *
13
+ * @module render/svg-path-flatten
14
+ */
15
+ import type { Point2 } from './svg-path-types.js';
16
+ export type { Point2 } from './svg-path-types.js';
17
+ /**
18
+ * Flatten an SVG path `d` string into one or more closed polygon loops.
19
+ *
20
+ * @param d - The path `d` attribute string (absolute or relative commands).
21
+ * @param curveSegments - Sample count per full curve (arcs scale down for
22
+ * short sweeps). Default 16, generous enough for shapes rendered at
23
+ * on-screen SmartArt sizes.
24
+ */
25
+ export declare function flattenSvgPath(d: string, curveSegments?: number): Point2[][];
26
+ //# sourceMappingURL=svg-path-flatten.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg-path-flatten.d.ts","sourceRoot":"","sources":["../../src/geometry/svg-path-flatten.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA0BlD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,SAAK,GAAG,MAAM,EAAE,EAAE,CA8HxE"}
@@ -0,0 +1,6 @@
1
+ /** A format-neutral two-dimensional point. */
2
+ export interface Point2 {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ //# sourceMappingURL=svg-path-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg-path-types.d.ts","sourceRoot":"","sources":["../../src/geometry/svg-path-types.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,MAAM,WAAW,MAAM;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACV"}