ducjs 1.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/legacy/index.d.ts +1 -1
  2. package/dist/legacy/index.js +1 -1
  3. package/dist/legacy/v1/parse/index.d.ts +22 -22
  4. package/dist/legacy/v1/parse/index.js +8 -8
  5. package/dist/legacy/v1/parse/parseAppStateFromBinary.d.ts +2 -2
  6. package/dist/legacy/v1/parse/parseAppStateFromBinary.js +3 -3
  7. package/dist/legacy/v1/parse/parseBinaryFilesFromBinary.d.ts +2 -2
  8. package/dist/legacy/v1/parse/parseBlockFromBinary.d.ts +2 -2
  9. package/dist/legacy/v1/parse/parseBlockFromBinary.js +1 -1
  10. package/dist/legacy/v1/parse/parseElementFromBinary.d.ts +3 -3
  11. package/dist/legacy/v1/parse/parseElementFromBinary.js +2 -2
  12. package/dist/legacy/v1/parse/parseGroupFromBinary.d.ts +3 -3
  13. package/dist/legacy/v1/parse/parseRendererStateFromBinary.d.ts +1 -1
  14. package/dist/legacy/v1/serialize/index.d.ts +3 -3
  15. package/dist/legacy/v1/serialize/index.js +9 -9
  16. package/dist/legacy/v1/serialize/serializationUtils.d.ts +1 -1
  17. package/dist/legacy/v1/serialize/serializeAppStateFromDuc.d.ts +1 -1
  18. package/dist/legacy/v1/serialize/serializeAppStateFromDuc.js +4 -4
  19. package/dist/legacy/v1/serialize/serializeBinaryFilesFromDuc.d.ts +1 -1
  20. package/dist/legacy/v1/serialize/serializeBinaryFilesFromDuc.js +2 -2
  21. package/dist/legacy/v1/serialize/serializeBlockFromDuc.d.ts +1 -1
  22. package/dist/legacy/v1/serialize/serializeBlockFromDuc.js +1 -1
  23. package/dist/legacy/v1/serialize/serializeElementFromDuc.d.ts +2 -2
  24. package/dist/legacy/v1/serialize/serializeElementFromDuc.js +3 -3
  25. package/dist/legacy/v1/serialize/serializeGroupFromDuc.d.ts +1 -1
  26. package/dist/legacy/v1/serialize/serializeGroupFromDuc.js +1 -1
  27. package/dist/legacy/v1/serialize/serializeRendererStateFromDuc.js +1 -1
  28. package/dist/legacy/v1/types/elements/index.d.ts +5 -5
  29. package/dist/legacy/v1/types/elements/typeChecks.d.ts +4 -4
  30. package/dist/legacy/v1/types/elements/typeChecks.js +1 -1
  31. package/dist/legacy/v1/types/geometryTypes.d.ts +1 -1
  32. package/dist/legacy/v1/types/index.d.ts +7 -7
  33. package/dist/legacy/v1/utils/bounds.d.ts +4 -4
  34. package/dist/legacy/v1/utils/bounds.js +4 -4
  35. package/dist/legacy/v1/utils/constants.d.ts +3 -3
  36. package/dist/legacy/v1/utils/constants.js +1 -1
  37. package/dist/legacy/v1/utils/elements/index.d.ts +4 -4
  38. package/dist/legacy/v1/utils/elements/index.js +5 -5
  39. package/dist/legacy/v1/utils/elements/linearElement.d.ts +6 -6
  40. package/dist/legacy/v1/utils/elements/linearElement.js +4 -4
  41. package/dist/legacy/v1/utils/elements/textElement.d.ts +7 -7
  42. package/dist/legacy/v1/utils/elements/textElement.js +7 -7
  43. package/dist/legacy/v1/utils/index.d.ts +1 -1
  44. package/dist/legacy/v1/utils/math/algebra/gadirections.d.ts +1 -1
  45. package/dist/legacy/v1/utils/math/algebra/gadirections.js +1 -1
  46. package/dist/legacy/v1/utils/math/algebra/galines.d.ts +1 -1
  47. package/dist/legacy/v1/utils/math/algebra/galines.js +1 -1
  48. package/dist/legacy/v1/utils/math/algebra/gapoints.d.ts +1 -1
  49. package/dist/legacy/v1/utils/math/algebra/gapoints.js +3 -3
  50. package/dist/legacy/v1/utils/math/algebra/gatransforms.d.ts +1 -1
  51. package/dist/legacy/v1/utils/math/algebra/gatransforms.js +2 -2
  52. package/dist/legacy/v1/utils/math/bbox.d.ts +2 -2
  53. package/dist/legacy/v1/utils/math/geometry.d.ts +3 -3
  54. package/dist/legacy/v1/utils/math/geometry.js +2 -2
  55. package/dist/legacy/v1/utils/math/index.d.ts +6 -6
  56. package/dist/legacy/v1/utils/math/index.js +3 -3
  57. package/dist/legacy/v1/utils/measurements.d.ts +2 -2
  58. package/dist/legacy/v1/utils/measurements.js +1 -1
  59. package/dist/legacy/v1/utils/normalize.d.ts +2 -2
  60. package/dist/legacy/v1/utils/normalize.js +2 -2
  61. package/dist/legacy/v1/utils/restore.d.ts +8 -8
  62. package/dist/legacy/v1/utils/restore.js +15 -15
  63. package/dist/legacy/v1/utils/scopes.d.ts +3 -3
  64. package/dist/legacy/v1/utils/standards.d.ts +1 -1
  65. package/dist/legacy/v1/utils/state/index.d.ts +1 -1
  66. package/dist/legacy/v1/utils/state/index.js +4 -4
  67. package/dist/parse.d.ts +4 -4
  68. package/dist/parse.js +3 -3
  69. package/dist/restore/restoreDataState.d.ts +8 -8
  70. package/dist/restore/restoreDataState.js +9 -9
  71. package/dist/restore/restoreElements.d.ts +2 -2
  72. package/dist/restore/restoreElements.js +5 -5
  73. package/dist/restore/restoreStandards.d.ts +2 -2
  74. package/dist/restore/restoreStandards.js +4 -4
  75. package/dist/serialize.d.ts +1 -1
  76. package/dist/serialize.js +3 -3
  77. package/dist/technical/measurements.d.ts +2 -2
  78. package/dist/technical/measurements.js +1 -1
  79. package/dist/technical/scopes.d.ts +4 -4
  80. package/dist/technical/scopes.js +1 -1
  81. package/dist/technical/standards.d.ts +4 -4
  82. package/dist/types/elements/index.d.ts +6 -6
  83. package/dist/types/elements/typeChecks.d.ts +4 -4
  84. package/dist/types/elements/typeChecks.js +1 -1
  85. package/dist/types/geometryTypes.d.ts +2 -2
  86. package/dist/types/index.d.ts +7 -7
  87. package/dist/utils/bounds.d.ts +3 -3
  88. package/dist/utils/bounds.js +3 -3
  89. package/dist/utils/constants.d.ts +3 -3
  90. package/dist/utils/constants.js +2 -2
  91. package/dist/utils/elements/frameElement.d.ts +1 -1
  92. package/dist/utils/elements/frameElement.js +1 -1
  93. package/dist/utils/elements/freedrawElement.d.ts +1 -1
  94. package/dist/utils/elements/freedrawElement.js +1 -1
  95. package/dist/utils/elements/index.d.ts +4 -4
  96. package/dist/utils/elements/index.js +6 -6
  97. package/dist/utils/elements/linearElement.d.ts +6 -6
  98. package/dist/utils/elements/linearElement.js +4 -4
  99. package/dist/utils/elements/newElement.d.ts +3 -3
  100. package/dist/utils/elements/newElement.js +8 -8
  101. package/dist/utils/elements/textElement.d.ts +7 -7
  102. package/dist/utils/elements/textElement.js +8 -8
  103. package/dist/utils/elements/viewportElement.d.ts +1 -1
  104. package/dist/utils/math/algebra/gadirections.d.ts +1 -1
  105. package/dist/utils/math/algebra/gadirections.js +1 -1
  106. package/dist/utils/math/algebra/galines.d.ts +1 -1
  107. package/dist/utils/math/algebra/galines.js +1 -1
  108. package/dist/utils/math/algebra/gapoints.d.ts +1 -1
  109. package/dist/utils/math/algebra/gapoints.js +3 -3
  110. package/dist/utils/math/algebra/gatransforms.d.ts +1 -1
  111. package/dist/utils/math/algebra/gatransforms.js +2 -2
  112. package/dist/utils/math/bbox.d.ts +2 -2
  113. package/dist/utils/math/geometry.d.ts +3 -3
  114. package/dist/utils/math/geometry.js +2 -2
  115. package/dist/utils/math/index.d.ts +6 -6
  116. package/dist/utils/math/index.js +3 -3
  117. package/dist/utils/normalize.d.ts +2 -2
  118. package/dist/utils/normalize.js +2 -2
  119. package/dist/utils/shape.d.ts +2 -2
  120. package/dist/utils/shape.js +8 -8
  121. package/dist/utils/state/grid.d.ts +1 -1
  122. package/dist/utils/state/grid.js +3 -3
  123. package/dist/utils/state/index.d.ts +1 -1
  124. package/dist/utils/state/index.js +7 -7
  125. package/dist/utils/version.d.ts +1 -1
  126. package/dist/utils/version.js +1 -1
  127. package/package.json +1 -1
@@ -1 +1 @@
1
- export * from "ducjs/legacy/v1";
1
+ export * from "./v1";
@@ -1 +1 @@
1
- export * from "ducjs/legacy/v1";
1
+ export * from "./v1";
@@ -1,17 +1,17 @@
1
1
  import { FileSystemHandle } from 'browser-fs-access';
2
- import { DucElement, DucBlock, DucGroup, OrderedDucElement } from 'ducjs/legacy/v1/types/elements';
3
- import { BinaryFiles } from 'ducjs/legacy/v1/types';
2
+ import { DucElement, DucBlock, DucGroup, OrderedDucElement } from '../types/elements';
3
+ import { BinaryFiles } from '../types';
4
4
  export declare const parseDucFlatBuffers: (blob: Blob | File, fileHandle?: FileSystemHandle | null) => Promise<{
5
5
  elements: OrderedDucElement[];
6
6
  appState: {
7
7
  activeTool: {
8
- lastActiveTool: import("ducjs/legacy/v1/types").ActiveTool | null;
8
+ lastActiveTool: import("../types").ActiveTool | null;
9
9
  locked: boolean;
10
10
  fromSelection: boolean;
11
- } & import("ducjs/legacy/v1/types").ActiveTool;
11
+ } & import("../types").ActiveTool;
12
12
  penMode: boolean;
13
13
  showHyperlinkPopup: false | "info" | "editor";
14
- antiAliasing: import("ducjs/legacy/v1/types").AntiAliasing;
14
+ antiAliasing: import("../types").AntiAliasing;
15
15
  vSync: boolean;
16
16
  zoomStep: number;
17
17
  scaleRatioLocked: boolean;
@@ -22,22 +22,22 @@ export declare const parseDucFlatBuffers: (blob: Blob | File, fileHandle?: FileS
22
22
  displayRootAxis: boolean;
23
23
  coordDecimalPlaces: number;
24
24
  lineBendingMode: boolean;
25
- currentItemStroke: import("ducjs/legacy/v1/types/elements").ElementStroke;
26
- currentItemBackground: import("ducjs/legacy/v1/types/elements").ElementBackground;
25
+ currentItemStroke: import("../types/elements").ElementStroke;
26
+ currentItemBackground: import("../types/elements").ElementBackground;
27
27
  currentItemOpacity: import("../types/geometryTypes").Percentage;
28
- currentItemFontFamily: import("ducjs/legacy/v1/types/elements").FontFamilyValues;
29
- currentItemFontSize: import("ducjs/legacy/v1/types/elements").DucTextElement["fontSize"];
30
- currentItemTextAlign: import("ducjs/legacy/v1/types/elements").TextAlign;
31
- currentItemStartLineHead: import("ducjs/legacy/v1/types/elements").LineHead | null;
32
- currentItemEndLineHead: import("ducjs/legacy/v1/types/elements").LineHead | null;
28
+ currentItemFontFamily: import("../types/elements").FontFamilyValues;
29
+ currentItemFontSize: import("../types/elements").DucTextElement["fontSize"];
30
+ currentItemTextAlign: import("../types/elements").TextAlign;
31
+ currentItemStartLineHead: import("../types/elements").LineHead | null;
32
+ currentItemEndLineHead: import("../types/elements").LineHead | null;
33
33
  currentItemRoundness: DucElement["roundness"];
34
34
  viewBackgroundColor: string;
35
- scope: import("ducjs/legacy/v1/types").Scope;
36
- mainScope: import("ducjs/legacy/v1/types").Scope;
35
+ scope: import("../types").Scope;
36
+ mainScope: import("../types").Scope;
37
37
  standard: import("../utils/standards").DesignStandard;
38
- scrollX: import("ducjs/legacy/v1/types").PrecisionValue;
39
- scrollY: import("ducjs/legacy/v1/types").PrecisionValue;
40
- zoom: import("ducjs/legacy/v1/types").Zoom;
38
+ scrollX: import("../types").PrecisionValue;
39
+ scrollY: import("../types").PrecisionValue;
40
+ zoom: import("../types").Zoom;
41
41
  name: string | null;
42
42
  scrolledOutside: boolean;
43
43
  selectedElementIds: Readonly<{
@@ -46,16 +46,16 @@ export declare const parseDucFlatBuffers: (blob: Blob | File, fileHandle?: FileS
46
46
  selectedGroupIds: {
47
47
  [groupId: string]: boolean;
48
48
  };
49
- activeGridSettings: import("ducjs/legacy/v1/types").GridSettings["id"][] | null;
50
- activeSnapSettings: import("ducjs/legacy/v1/types").SnapSettings["id"] | null;
49
+ activeGridSettings: import("../types").GridSettings["id"][] | null;
50
+ activeSnapSettings: import("../types").SnapSettings["id"] | null;
51
51
  gridSize: number;
52
52
  gridStep: number;
53
53
  debugRendering: boolean;
54
54
  editingLinearElement: import("../utils/elements/linearElement").LinearElementEditor | null;
55
55
  scopeExponentThreshold: number;
56
- elementHovered: import("ducjs/legacy/v1/types/elements").NonDeleted<DucElement> | null;
57
- elementsPendingErasure: import("ducjs/legacy/v1/types").ElementsPendingErasure;
58
- suggestedBindings: import("ducjs/legacy/v1/types").SuggestedBinding[];
56
+ elementHovered: import("../types/elements").NonDeleted<DucElement> | null;
57
+ elementsPendingErasure: import("../types").ElementsPendingErasure;
58
+ suggestedBindings: import("../types").SuggestedBinding[];
59
59
  isBindingEnabled: boolean;
60
60
  };
61
61
  files: BinaryFiles;
@@ -19,14 +19,14 @@ var __rest = (this && this.__rest) || function (s, e) {
19
19
  return t;
20
20
  };
21
21
  import * as flatbuffers from 'flatbuffers';
22
- import { restore } from 'ducjs/legacy/v1/utils/restore';
23
- import { ExportedDataState } from 'ducjs/legacy/v1/duc';
24
- import { parseAppStateFromBinary } from 'ducjs/legacy/v1/parse/parseAppStateFromBinary';
25
- import { parseBinaryFilesFromBinary } from 'ducjs/legacy/v1/parse/parseBinaryFilesFromBinary';
26
- import { parseElementFromBinary } from 'ducjs/legacy/v1/parse/parseElementFromBinary';
27
- import { parseRendererStateFromBinary } from 'ducjs/legacy/v1/parse/parseRendererStateFromBinary';
28
- import { parseBlockFromBinary } from 'ducjs/legacy/v1/parse/parseBlockFromBinary';
29
- import { parseGroupFromBinary } from 'ducjs/legacy/v1/parse/parseGroupFromBinary';
22
+ import { restore } from '../utils/restore';
23
+ import { ExportedDataState } from '../duc';
24
+ import { parseAppStateFromBinary } from './parseAppStateFromBinary';
25
+ import { parseBinaryFilesFromBinary } from './parseBinaryFilesFromBinary';
26
+ import { parseElementFromBinary } from './parseElementFromBinary';
27
+ import { parseRendererStateFromBinary } from './parseRendererStateFromBinary';
28
+ import { parseBlockFromBinary } from './parseBlockFromBinary';
29
+ import { parseGroupFromBinary } from './parseGroupFromBinary';
30
30
  export const parseDucFlatBuffers = (blob_1, ...args_1) => __awaiter(void 0, [blob_1, ...args_1], void 0, function* (blob, fileHandle = null) {
31
31
  const arrayBuffer = yield blob.arrayBuffer();
32
32
  const byteBuffer = new flatbuffers.ByteBuffer(new Uint8Array(arrayBuffer));
@@ -1,3 +1,3 @@
1
- import { AppState as BinAppState } from 'ducjs/legacy/v1/duc';
2
- import { DucState } from 'ducjs/legacy/v1/types';
1
+ import { AppState as BinAppState } from '../duc';
2
+ import { DucState } from '../types';
3
3
  export declare const parseAppStateFromBinary: (appStateBin: BinAppState | null, v: number) => Partial<DucState>;
@@ -1,6 +1,6 @@
1
- import { parseElementBinBackground, parseElementBinStroke, parsePoint } from 'ducjs/legacy/v1/parse/parseElementFromBinary';
2
- import { getPrecisionValueFromRaw, NEUTRAL_SCOPE } from 'ducjs/legacy/v1/utils/scopes';
3
- import { HANDLE_TYPE } from 'ducjs/legacy/v1/utils/constants';
1
+ import { parseElementBinBackground, parseElementBinStroke, parsePoint } from './parseElementFromBinary';
2
+ import { getPrecisionValueFromRaw, NEUTRAL_SCOPE } from '../utils/scopes';
3
+ import { HANDLE_TYPE } from '../utils/constants';
4
4
  export const parseAppStateFromBinary = (appStateBin, v) => {
5
5
  var _a;
6
6
  if (!appStateBin)
@@ -1,4 +1,4 @@
1
- import { BinaryFiles as BinBinaryFiles } from 'ducjs/legacy/v1/duc';
2
- import { BinaryFiles } from 'ducjs/legacy/v1/types';
1
+ import { BinaryFiles as BinBinaryFiles } from '../duc';
2
+ import { BinaryFiles } from '../types';
3
3
  export declare const uint8ArrayToDataURL: (uint8Array: Uint8Array, mimeType: string) => string;
4
4
  export declare const parseBinaryFilesFromBinary: (binaryFiles: BinBinaryFiles | null) => BinaryFiles;
@@ -1,3 +1,3 @@
1
- import { DucBlock as BinDucBlock } from 'ducjs/legacy/v1/duc';
2
- import { DucBlock } from 'ducjs/legacy/v1/types/elements';
1
+ import { DucBlock as BinDucBlock } from '../duc';
2
+ import { DucBlock } from '../types/elements';
3
3
  export declare const parseBlockFromBinary: (block: BinDucBlock, version: number) => Partial<DucBlock> | null;
@@ -1,4 +1,4 @@
1
- import { getPrecisionValueFromRaw, NEUTRAL_SCOPE } from 'ducjs/legacy/v1/utils/scopes';
1
+ import { getPrecisionValueFromRaw, NEUTRAL_SCOPE } from '../utils/scopes';
2
2
  import { parseElementFromBinary } from './parseElementFromBinary';
3
3
  export const parseBlockFromBinary = (block, version) => {
4
4
  if (!block)
@@ -1,6 +1,6 @@
1
- import { DucElement as BinDucElement, ElementBackground as BinElementBackground, ElementContentBase as BinElementContentBase, ElementStroke as BinElementStroke, Point as BinPoint } from 'ducjs/legacy/v1/duc';
2
- import { SupportedMeasures } from 'ducjs/legacy/v1/utils/measurements';
3
- import { DucElement, DucPoint, ElementBackground, ElementContentBase, ElementStroke } from 'ducjs/legacy/v1/types/elements';
1
+ import { DucElement as BinDucElement, ElementBackground as BinElementBackground, ElementContentBase as BinElementContentBase, ElementStroke as BinElementStroke, Point as BinPoint } from '../duc';
2
+ import { SupportedMeasures } from '../utils/measurements';
3
+ import { DucElement, DucPoint, ElementBackground, ElementContentBase, ElementStroke } from '../types/elements';
4
4
  export declare const parsePoint: (point: BinPoint | null, elementScope: SupportedMeasures) => DucPoint | null;
5
5
  export declare const parseElementFromBinary: (e: BinDucElement, v: number) => Partial<DucElement> | null;
6
6
  export declare const parseElementContentBase: (content: BinElementContentBase | null, defaults: ElementContentBase) => ElementContentBase;
@@ -1,5 +1,5 @@
1
- import { getPrecisionValueFromRaw, NEUTRAL_SCOPE } from 'ducjs/legacy/v1/utils/scopes';
2
- import { DEFAULT_ELEMENT_PROPS, FREEDRAW_EASINGS } from 'ducjs/legacy/v1/utils/constants';
1
+ import { getPrecisionValueFromRaw, NEUTRAL_SCOPE } from '../utils/scopes';
2
+ import { DEFAULT_ELEMENT_PROPS, FREEDRAW_EASINGS } from '../utils/constants';
3
3
  import tinycolor from 'tinycolor2';
4
4
  export const parsePoint = (point, elementScope) => {
5
5
  if (!point)
@@ -1,4 +1,4 @@
1
- import { DucGroup as BinDucGroup } from 'ducjs/legacy/v1/duc';
2
- import { DucGroup } from 'ducjs/legacy/v1/types/elements';
3
- import { Scope } from 'ducjs/legacy/v1/types';
1
+ import { DucGroup as BinDucGroup } from '../duc';
2
+ import { DucGroup } from '../types/elements';
3
+ import { Scope } from '../types';
4
4
  export declare const parseGroupFromBinary: (group: BinDucGroup, currentScope: Scope) => Partial<DucGroup> | null;
@@ -1,4 +1,4 @@
1
- import { RendererState } from 'ducjs/legacy/v1/duc';
1
+ import { RendererState } from '../duc';
2
2
  export declare const parseRendererStateFromBinary: (rendererState: RendererState | null) => {
3
3
  deletedElementIds: string[];
4
4
  };
@@ -1,5 +1,5 @@
1
- import { DucBlock, DucElement, DucGroup } from 'ducjs/legacy/v1/types/elements';
2
- import { BinaryFiles, RendererState, DucState } from 'ducjs/legacy/v1/types';
3
- import { ExtendedAppStateRestorer } from 'ducjs/legacy/v1/utils/restore';
1
+ import { DucBlock, DucElement, DucGroup } from '../types/elements';
2
+ import { BinaryFiles, RendererState, DucState } from '../types';
3
+ import { ExtendedAppStateRestorer } from '../utils/restore';
4
4
  export declare const DUC_SCHEMA_VERSION: string;
5
5
  export declare const serializeAsFlatBuffers: (elements: readonly DucElement[], ducState: Partial<DucState>, files: BinaryFiles, blocks: readonly DucBlock[], groups: readonly DucGroup[], rendererState?: RendererState, extendedAppStateRestorer?: ExtendedAppStateRestorer<DucState>) => Promise<Uint8Array>;
@@ -8,15 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import * as flatbuffers from 'flatbuffers';
11
- import { ExportedDataState, } from 'ducjs/legacy/v1/duc';
12
- import { EXPORT_DATA_TYPES } from 'ducjs/legacy/v1/utils/constants';
13
- import { serializeDucElement } from 'ducjs/legacy/v1/serialize/serializeElementFromDuc';
14
- import { serializeAppState } from 'ducjs/legacy/v1/serialize/serializeAppStateFromDuc';
15
- import { serializeBinaryFiles } from 'ducjs/legacy/v1/serialize/serializeBinaryFilesFromDuc';
16
- import { restore, noopExtendedAppStateRestorer } from 'ducjs/legacy/v1/utils/restore';
17
- import { serializeRendererState } from 'ducjs/legacy/v1/serialize/serializeRendererStateFromDuc';
18
- import { serializeDucBlock } from 'ducjs/legacy/v1/serialize/serializeBlockFromDuc';
19
- import { serializeDucGroup } from 'ducjs/legacy/v1/serialize/serializeGroupFromDuc';
11
+ import { ExportedDataState, } from '../duc';
12
+ import { EXPORT_DATA_TYPES } from '../utils/constants';
13
+ import { serializeDucElement } from './serializeElementFromDuc';
14
+ import { serializeAppState } from './serializeAppStateFromDuc';
15
+ import { serializeBinaryFiles } from './serializeBinaryFilesFromDuc';
16
+ import { restore, noopExtendedAppStateRestorer } from '../utils/restore';
17
+ import { serializeRendererState } from './serializeRendererStateFromDuc';
18
+ import { serializeDucBlock } from './serializeBlockFromDuc';
19
+ import { serializeDucGroup } from './serializeGroupFromDuc';
20
20
  export const DUC_SCHEMA_VERSION = process.env.DUC_SCHEMA_VERSION || "0.0.0";
21
21
  export const serializeAsFlatBuffers = (elements_1, ducState_1, files_1, blocks_1, groups_1, rendererState_1, ...args_1) => __awaiter(void 0, [elements_1, ducState_1, files_1, blocks_1, groups_1, rendererState_1, ...args_1], void 0, function* (elements, ducState, files, blocks, groups, rendererState, extendedAppStateRestorer = noopExtendedAppStateRestorer) {
22
22
  var _a;
@@ -1,4 +1,4 @@
1
- import { PrecisionValue } from 'ducjs/legacy/v1/types';
1
+ import { PrecisionValue } from '../types';
2
2
  /**
3
3
  * Ensures that a given number is finite. If not, returns a default value.
4
4
  * This is primarily for internal use within serialization helpers like getPrecisionValueField,
@@ -1,4 +1,4 @@
1
1
  import * as flatbuffers from 'flatbuffers';
2
- import { DucState } from 'ducjs/legacy/v1/types';
2
+ import { DucState } from '../types';
3
3
  declare const serializeAppState: (builder: flatbuffers.Builder, appState: Partial<DucState>, forRenderer: boolean) => flatbuffers.Offset;
4
4
  export { serializeAppState };
@@ -1,7 +1,7 @@
1
- import { HANDLE_TYPE } from 'ducjs/legacy/v1/utils/constants';
2
- import { AppState as BinAppState, LinearElementEditor, PointerDownState, SegmentMidpointState, SimplePoint } from 'ducjs/legacy/v1/duc';
3
- import { ensureFiniteNumber, getPrecisionValueField } from 'ducjs/legacy/v1/serialize/serializationUtils';
4
- import { serializeDucPoint, serializeElementBackground, serializeElementStroke } from 'ducjs/legacy/v1/serialize/serializeElementFromDuc';
1
+ import { HANDLE_TYPE } from '../utils/constants';
2
+ import { AppState as BinAppState, LinearElementEditor, PointerDownState, SegmentMidpointState, SimplePoint } from '../duc';
3
+ import { ensureFiniteNumber, getPrecisionValueField } from './serializationUtils';
4
+ import { serializeDucPoint, serializeElementBackground, serializeElementStroke } from './serializeElementFromDuc';
5
5
  const serializeAppState = (builder, appState, forRenderer) => {
6
6
  var _a, _b;
7
7
  const nameOffset = appState.name ? builder.createString(appState.name) : undefined;
@@ -1,4 +1,4 @@
1
1
  import * as flatbuffers from 'flatbuffers';
2
- import { BinaryFiles as BinaryFilesType } from 'ducjs/legacy/v1/types';
2
+ import { BinaryFiles as BinaryFilesType } from '../types';
3
3
  declare const serializeBinaryFiles: (builder: flatbuffers.Builder, files: BinaryFilesType) => flatbuffers.Offset;
4
4
  export { serializeBinaryFiles };
@@ -1,5 +1,5 @@
1
- import { BinaryFileData, BinaryFilesEntry, BinaryFiles as BinBinaryFiles } from 'ducjs/legacy/v1/duc';
2
- import { ensureFiniteNumber } from 'ducjs/legacy/v1/serialize/serializationUtils'; // Import shared helper
1
+ import { BinaryFileData, BinaryFilesEntry, BinaryFiles as BinBinaryFiles } from '../duc';
2
+ import { ensureFiniteNumber } from './serializationUtils'; // Import shared helper
3
3
  // Helper function to convert a DataURL (base64 string) to Uint8Array
4
4
  const dataURLToUint8Array = (dataURL) => {
5
5
  if (!dataURL || dataURL.indexOf(',') === -1) { // Added check for valid dataURL format
@@ -1,3 +1,3 @@
1
1
  import * as flatbuffers from 'flatbuffers';
2
- import { DucBlock } from 'ducjs/legacy/v1/types/elements';
2
+ import { DucBlock } from '../types/elements';
3
3
  export declare const serializeDucBlock: (builder: flatbuffers.Builder, block: DucBlock, forRenderer?: boolean) => flatbuffers.Offset;
@@ -1,4 +1,4 @@
1
- import { DucBlock as BinDucBlock, DucBlockAttribute as BinDucBlockAttribute, DucBlockAttributeDetails as BinDucBlockAttributeDetails, SimplePoint, } from 'ducjs/legacy/v1/duc';
1
+ import { DucBlock as BinDucBlock, DucBlockAttribute as BinDucBlockAttribute, DucBlockAttributeDetails as BinDucBlockAttributeDetails, SimplePoint, } from '../duc';
2
2
  import { serializeDucElement } from './serializeElementFromDuc';
3
3
  import { getPrecisionValueField } from './serializationUtils';
4
4
  export const serializeDucBlock = (builder, block, forRenderer = false) => {
@@ -1,5 +1,5 @@
1
- import type { DucPoint } from 'ducjs/legacy/v1/types/elements';
2
- import { DucElement, DucPointBinding, ElementBackground, ElementStroke } from 'ducjs/legacy/v1/types/elements';
1
+ import type { DucPoint } from '../types/elements';
2
+ import { DucElement, DucPointBinding, ElementBackground, ElementStroke } from '../types/elements';
3
3
  import * as flatbuffers from 'flatbuffers';
4
4
  export declare const serializeDucElement: (builder: flatbuffers.Builder, element: DucElement, forRenderer?: boolean) => flatbuffers.Offset;
5
5
  export declare const serializeDucPoint: (builder: flatbuffers.Builder, point: DucPoint, forRenderer: boolean) => flatbuffers.Offset;
@@ -1,6 +1,6 @@
1
- import { BindingPoint as BinBindingPoint, BoundElement as BinBoundElement, DucBlockInstanceElementOverride as BinDucBlockInstanceElementOverride, DucElement as BinDucElement, DucLine as BinDucLine, DucLineReference as BinDucLineReference, DucPath as BinDucPath, DucTableCell as BinDucTableCell, DucTableColumn as BinDucTableColumn, DucTableRow as BinDucTableRow, DucTableStyle as BinDucTableStyle, DucTableStyleProps as BinDucTableStyleProps, ElementBackground as BinElementBackground, ElementContentBase as BinElementContentBase, ElementStroke as BinElementStroke, ImageCrop as BinImageCrop, Point as BinPoint, PointBinding as BinPointBinding, SimplePoint as BinSimplePoint, StrokeSides as BinStrokeSides, StrokeStyle as BinStrokeStyle, TilingProperties as BinTilingProperties } from 'ducjs/legacy/v1/duc';
2
- import { isLinearElement } from 'ducjs/legacy/v1/types/elements/typeChecks';
3
- import { ensureFiniteNumber, getPrecisionValueField } from 'ducjs/legacy/v1/serialize/serializationUtils';
1
+ import { BindingPoint as BinBindingPoint, BoundElement as BinBoundElement, DucBlockInstanceElementOverride as BinDucBlockInstanceElementOverride, DucElement as BinDucElement, DucLine as BinDucLine, DucLineReference as BinDucLineReference, DucPath as BinDucPath, DucTableCell as BinDucTableCell, DucTableColumn as BinDucTableColumn, DucTableRow as BinDucTableRow, DucTableStyle as BinDucTableStyle, DucTableStyleProps as BinDucTableStyleProps, ElementBackground as BinElementBackground, ElementContentBase as BinElementContentBase, ElementStroke as BinElementStroke, ImageCrop as BinImageCrop, Point as BinPoint, PointBinding as BinPointBinding, SimplePoint as BinSimplePoint, StrokeSides as BinStrokeSides, StrokeStyle as BinStrokeStyle, TilingProperties as BinTilingProperties } from '../duc';
2
+ import { isLinearElement } from '../types/elements/typeChecks';
3
+ import { ensureFiniteNumber, getPrecisionValueField } from './serializationUtils';
4
4
  export const serializeDucElement = (builder, element, forRenderer = false) => {
5
5
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
6
6
  const idOffset = builder.createString(element.id);
@@ -1,3 +1,3 @@
1
1
  import * as flatbuffers from 'flatbuffers';
2
- import { DucGroup } from 'ducjs/legacy/v1/types/elements';
2
+ import { DucGroup } from '../types/elements';
3
3
  export declare const serializeDucGroup: (builder: flatbuffers.Builder, group: DucGroup, forRenderer?: boolean) => flatbuffers.Offset;
@@ -1,4 +1,4 @@
1
- import { DucGroup as BinDucGroup, } from 'ducjs/legacy/v1/duc';
1
+ import { DucGroup as BinDucGroup, } from '../duc';
2
2
  import { serializeElementStroke, serializeElementBackground } from './serializeElementFromDuc';
3
3
  export const serializeDucGroup = (builder, group, forRenderer = false) => {
4
4
  // Create string offsets
@@ -1,4 +1,4 @@
1
- import { RendererState } from 'ducjs/legacy/v1/duc';
1
+ import { RendererState } from '../duc';
2
2
  export const serializeRendererState = (builder, rendererState) => {
3
3
  const deletedElementIdsOffset = RendererState.createDeletedElementIdsVector(builder, rendererState.deletedElementIds.map((id) => builder.createString(id)));
4
4
  RendererState.startRendererState(builder);
@@ -1,8 +1,8 @@
1
- import { LINE_HEAD, BLENDING, ELEMENT_CONTENT_PREFERENCE, FONT_FAMILY, IMAGE_STATUS, STROKE_CAP, STROKE_JOIN, STROKE_PLACEMENT, STROKE_PREFERENCE, STROKE_SIDE_PREFERENCE, TEXT_ALIGN, THEME, VERTICAL_ALIGN, ELEMENT_SUBSET, BEZIER_MIRRORING, FREEDRAW_EASINGS } from "ducjs/legacy/v1/utils/constants";
2
- import { MakeBrand, MarkNonNullable, MarkOptional, Merge, ValueOf } from "ducjs/legacy/v1/types/utility-types";
3
- import { SupportedMeasures } from "ducjs/legacy/v1/utils/measurements";
4
- import { PrecisionValue } from "ducjs/legacy/v1/types";
5
- import { Percentage, Radian, GeometricPoint } from "ducjs/legacy/v1/types/geometryTypes";
1
+ import { LINE_HEAD, BLENDING, ELEMENT_CONTENT_PREFERENCE, FONT_FAMILY, IMAGE_STATUS, STROKE_CAP, STROKE_JOIN, STROKE_PLACEMENT, STROKE_PREFERENCE, STROKE_SIDE_PREFERENCE, TEXT_ALIGN, THEME, VERTICAL_ALIGN, ELEMENT_SUBSET, BEZIER_MIRRORING, FREEDRAW_EASINGS } from "../../utils/constants";
2
+ import { MakeBrand, MarkNonNullable, MarkOptional, Merge, ValueOf } from "../utility-types";
3
+ import { SupportedMeasures } from "../../utils/measurements";
4
+ import { PrecisionValue } from "..";
5
+ import { Percentage, Radian, GeometricPoint } from "../geometryTypes";
6
6
  export type ChartType = "bar" | "line";
7
7
  export type FontFamilyKeys = keyof typeof FONT_FAMILY;
8
8
  export type FontFamilyValues = typeof FONT_FAMILY[FontFamilyKeys];
@@ -1,7 +1,7 @@
1
- import type { ElementOrToolType } from "ducjs/legacy/v1/types";
2
- import type { MarkNonNullable } from "ducjs/legacy/v1/types/utility-types";
3
- import { Bounds, LineSegment, TuplePoint } from "ducjs/legacy/v1/types/geometryTypes";
4
- import type { DucArrowElement, DucBindableElement, DucElbowArrowElement, DucElement, DucElementType, DucEmbeddableElement, DucFlowchartNodeElement, DucFrameElement, DucFrameLikeElement, DucFreeDrawElement, DucImageElement, DucLinearElement, DucTableElement, DucPointBinding, DucTextContainer, DucTextElement, DucTextElementWithContainer, FixedPointBinding, InitializedDucImageElement, DucNonSelectionElement, DucEllipseElement, DucPolygonElement, DucBlockInstanceElement, NonDeleted, DucIframeLikeElement } from "ducjs/legacy/v1/types/elements";
1
+ import type { ElementOrToolType } from "..";
2
+ import type { MarkNonNullable } from "../utility-types";
3
+ import { Bounds, LineSegment, TuplePoint } from "../geometryTypes";
4
+ import type { DucArrowElement, DucBindableElement, DucElbowArrowElement, DucElement, DucElementType, DucEmbeddableElement, DucFlowchartNodeElement, DucFrameElement, DucFrameLikeElement, DucFreeDrawElement, DucImageElement, DucLinearElement, DucTableElement, DucPointBinding, DucTextContainer, DucTextElement, DucTextElementWithContainer, FixedPointBinding, InitializedDucImageElement, DucNonSelectionElement, DucEllipseElement, DucPolygonElement, DucBlockInstanceElement, NonDeleted, DucIframeLikeElement } from "./";
5
5
  export declare const isInitializedImageElement: (element: DucElement | null) => element is InitializedDucImageElement;
6
6
  export declare const isImageElement: (element: DucElement | null) => element is DucImageElement;
7
7
  export declare const isEmbeddableElement: (element: DucElement | null | undefined) => element is DucEmbeddableElement;
@@ -1,4 +1,4 @@
1
- import { assertNever } from "ducjs/legacy/v1/utils";
1
+ import { assertNever } from "../../utils";
2
2
  export const isInitializedImageElement = (element) => {
3
3
  return !!element && element.type === "image" && !!element.fileId;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { ScopedValue } from "ducjs/legacy/v1/types";
1
+ import { ScopedValue } from "./";
2
2
  /**
3
3
  * x and y position of top left corner, x and y position of bottom right corner
4
4
  */
@@ -1,10 +1,10 @@
1
- import { DucBindableElement, DucElement, DucElementType, DucIframeLikeElement, DucLinearElement, DucTextElement, ElementBackground, ElementStroke, FileId, FontFamilyValues, LineHead, NonDeleted, TextAlign } from "ducjs/legacy/v1/types/elements";
2
- import { GeometricPoint, Percentage, Radian } from "ducjs/legacy/v1/types/geometryTypes";
3
- import { MakeBrand, MaybePromise, ValueOf } from "ducjs/legacy/v1/types/utility-types";
4
- import type { ANTI_ALIASING, GRID_DISPLAY_TYPE, GRID_TYPE, IMAGE_MIME_TYPES, MIME_TYPES, OBJECT_SNAP_MODE, SNAP_MARKER_SHAPE, SNAP_MODE, SNAP_OVERRIDE_BEHAVIOR } from "ducjs/legacy/v1/utils/constants";
5
- import { LinearElementEditor } from "ducjs/legacy/v1/utils/elements/linearElement";
6
- import { SupportedMeasures } from "ducjs/legacy/v1/utils/measurements";
7
- import { DesignStandard } from "ducjs/legacy/v1/utils/standards";
1
+ import { DucBindableElement, DucElement, DucElementType, DucIframeLikeElement, DucLinearElement, DucTextElement, ElementBackground, ElementStroke, FileId, FontFamilyValues, LineHead, NonDeleted, TextAlign } from "./elements";
2
+ import { GeometricPoint, Percentage, Radian } from "./geometryTypes";
3
+ import { MakeBrand, MaybePromise, ValueOf } from "./utility-types";
4
+ import type { ANTI_ALIASING, GRID_DISPLAY_TYPE, GRID_TYPE, IMAGE_MIME_TYPES, MIME_TYPES, OBJECT_SNAP_MODE, SNAP_MARKER_SHAPE, SNAP_MODE, SNAP_OVERRIDE_BEHAVIOR } from "../utils/constants";
5
+ import { LinearElementEditor } from "../utils/elements/linearElement";
6
+ import { SupportedMeasures } from "../utils/measurements";
7
+ import { DesignStandard } from "../utils/standards";
8
8
  export type Scope = SupportedMeasures;
9
9
  export type DataURL = string & {
10
10
  _brand: "DataURL";
@@ -1,7 +1,7 @@
1
- import { Scope, ScopedValue } from "ducjs/legacy/v1/types";
2
- import { DucElement, DucFreeDrawElement, DucLine, DucLinearElement, DucPoint, DucTextContainer, DucTextElement, DucTextElementWithContainer, ElementsMap } from "ducjs/legacy/v1/types/elements";
3
- import { Bounds } from "ducjs/legacy/v1/types/geometryTypes";
4
- import { GeometricPoint } from "ducjs/legacy/v1/types/geometryTypes";
1
+ import { Scope, ScopedValue } from "../types";
2
+ import { DucElement, DucFreeDrawElement, DucLine, DucLinearElement, DucPoint, DucTextContainer, DucTextElement, DucTextElementWithContainer, ElementsMap } from "../types/elements";
3
+ import { Bounds } from "../types/geometryTypes";
4
+ import { GeometricPoint } from "../types/geometryTypes";
5
5
  type SV = ScopedValue;
6
6
  /**
7
7
  * Common bounds calculation interface
@@ -1,7 +1,7 @@
1
- import { getCubicBezierBoundingBox, getQuadraticBezierBoundingBox, rescaleLines, rescalePoints } from "ducjs/legacy/v1/utils/math";
2
- import { rotate } from "ducjs/legacy/v1/utils/math";
3
- import { isFreeDrawElement, isLinearElement, isTextElement, isArrowElement } from "ducjs/legacy/v1/types/elements/typeChecks";
4
- import { getBoundTextElementPosition, getLinearElementAbsoluteCoords } from "ducjs/legacy/v1/utils/elements/linearElement";
1
+ import { getCubicBezierBoundingBox, getQuadraticBezierBoundingBox, rescaleLines, rescalePoints } from "./math";
2
+ import { rotate } from "./math";
3
+ import { isFreeDrawElement, isLinearElement, isTextElement, isArrowElement } from "../types/elements/typeChecks";
4
+ import { getBoundTextElementPosition, getLinearElementAbsoluteCoords } from "./elements/linearElement";
5
5
  export const getElementAbsoluteCoords = (element, elementsMap, currentScope, includeBoundText = false, returnUnrotatedBoundsOnly = true) => {
6
6
  if (isFreeDrawElement(element)) {
7
7
  return getFreeDrawElementAbsoluteCoords(element);
@@ -1,6 +1,6 @@
1
- import { GridSettings, RawValue, SnapSettings } from "ducjs/legacy/v1/types";
2
- import { DucElement, DucEllipseElement, DucFreeDrawElement, DucTextElement, ElementBackground, ElementStroke, FontFamilyValues } from "ducjs/legacy/v1/types/elements";
3
- import { MAX_ZOOM, MIN_ZOOM } from "ducjs/legacy/v1/utils/scopes";
1
+ import { GridSettings, RawValue, SnapSettings } from "../types";
2
+ import { DucElement, DucEllipseElement, DucFreeDrawElement, DucTextElement, ElementBackground, ElementStroke, FontFamilyValues } from "../types/elements";
3
+ import { MAX_ZOOM, MIN_ZOOM } from "./scopes";
4
4
  export declare const COLOR_PALETTE: {
5
5
  readonly transparent: "transparent";
6
6
  readonly black: "#1e1e1e";
@@ -1,4 +1,4 @@
1
- import { MAX_ZOOM, MIN_ZOOM, NEUTRAL_SCOPE } from "ducjs/legacy/v1/utils/scopes";
1
+ import { MAX_ZOOM, MIN_ZOOM, NEUTRAL_SCOPE } from "./scopes";
2
2
  export const COLOR_PALETTE = {
3
3
  transparent: "transparent",
4
4
  black: "#1e1e1e",
@@ -1,7 +1,7 @@
1
- import { Scope } from "ducjs/legacy/v1/types";
2
- import { _DucStackBase, DucElement, DucTableElement, NonDeleted } from "ducjs/legacy/v1/types/elements";
3
- import { GeometricPoint, TuplePoint } from "ducjs/legacy/v1/types/geometryTypes";
4
- import { Mutable } from "ducjs/legacy/v1/types/utility-types";
1
+ import { Scope } from "../../types";
2
+ import { _DucStackBase, DucElement, DucTableElement, NonDeleted } from "../../types/elements";
3
+ import { GeometricPoint, TuplePoint } from "../../types/geometryTypes";
4
+ import { Mutable } from "../../types/utility-types";
5
5
  /**
6
6
  * Mutates element, bumping `version`, `versionNonce`, and `updated`.
7
7
  *
@@ -1,8 +1,8 @@
1
- import { isFreeDrawElement, isLinearElement } from "ducjs/legacy/v1/types/elements/typeChecks";
2
- import { getUpdatedTimestamp } from "ducjs/legacy/v1/utils";
3
- import { DEFAULT_ELEMENT_PROPS, DEFAULT_FONT_SIZE, TEXT_ALIGN } from "ducjs/legacy/v1/utils/constants";
4
- import { randomInteger } from "ducjs/legacy/v1/utils/math/random";
5
- import { getPrecisionValueFromRaw } from "ducjs/legacy/v1/utils/scopes";
1
+ import { isFreeDrawElement, isLinearElement } from "../../types/elements/typeChecks";
2
+ import { getUpdatedTimestamp } from "..";
3
+ import { DEFAULT_ELEMENT_PROPS, DEFAULT_FONT_SIZE, TEXT_ALIGN } from "../constants";
4
+ import { randomInteger } from "../math/random";
5
+ import { getPrecisionValueFromRaw } from "../scopes";
6
6
  /**
7
7
  * Mutates element, bumping `version`, `versionNonce`, and `updated`.
8
8
  *
@@ -1,9 +1,9 @@
1
- import type { PrecisionValue, RawValue, Scope } from "ducjs/legacy/v1/types";
2
- import type { DucBindableElement, DucElement, DucLine, DucLinearElement, DucPoint, DucTextElementWithContainer, ElementsMap, NonDeleted } from "ducjs/legacy/v1/types/elements";
3
- import { Bounds, GeometricPoint } from "ducjs/legacy/v1/types/geometryTypes";
4
- import type { ValueOf } from "ducjs/legacy/v1/types/utility-types";
5
- import { ElementAbsoluteCoords } from "ducjs/legacy/v1/utils/bounds";
6
- import { HANDLE_TYPE } from "ducjs/legacy/v1/utils/constants";
1
+ import type { PrecisionValue, RawValue, Scope } from "../../types";
2
+ import type { DucBindableElement, DucElement, DucLine, DucLinearElement, DucPoint, DucTextElementWithContainer, ElementsMap, NonDeleted } from "../../types/elements";
3
+ import { Bounds, GeometricPoint } from "../../types/geometryTypes";
4
+ import type { ValueOf } from "../../types/utility-types";
5
+ import { ElementAbsoluteCoords } from "../bounds";
6
+ import { HANDLE_TYPE } from "../constants";
7
7
  export type HandleType = ValueOf<typeof HANDLE_TYPE> | null;
8
8
  export type HandleInfo = {
9
9
  pointIndex: number;
@@ -1,7 +1,7 @@
1
- import { getBoundTextElement, getElementAbsoluteCoords, getElementPointsCoords } from "ducjs/legacy/v1/utils/bounds";
2
- import { LINE_CONFIRM_THRESHOLD } from "ducjs/legacy/v1/utils/constants";
3
- import { centerPoint, getBezierXY, getCubicBezierBoundingBox, getQuadraticBezierBoundingBox, rotate, rotatePoint, getControlPointsForBezierCurve, mapIntervalToBezierT } from "ducjs/legacy/v1/utils/math";
4
- import { getPrecisionValueFromRaw, getPrecisionValueFromScoped, getScopedBezierPointFromDucPoint } from "ducjs/legacy/v1/utils/scopes";
1
+ import { getBoundTextElement, getElementAbsoluteCoords, getElementPointsCoords } from "../bounds";
2
+ import { LINE_CONFIRM_THRESHOLD } from "../constants";
3
+ import { centerPoint, getBezierXY, getCubicBezierBoundingBox, getQuadraticBezierBoundingBox, rotate, rotatePoint, getControlPointsForBezierCurve, mapIntervalToBezierT } from "../math";
4
+ import { getPrecisionValueFromRaw, getPrecisionValueFromScoped, getScopedBezierPointFromDucPoint } from "../scopes";
5
5
  /**
6
6
  * Merges overlapping points using the line-based system
7
7
  * Returns updated points and lines arrays
@@ -1,9 +1,9 @@
1
- import { DucState, RawValue, Scope, ScopedValue } from "ducjs/legacy/v1/types";
2
- import { DucElement, DucElementType, DucTextContainer, DucTextElement, DucTextElementWithContainer, ElementsMap, FontFamilyValues, FontString, NonDeletedDucElement } from "ducjs/legacy/v1/types/elements";
3
- import { GeometricPoint } from "ducjs/legacy/v1/types/geometryTypes";
4
- import { ExtractSetType } from "ducjs/legacy/v1/types/utility-types";
5
- import { getBoundTextElementPosition } from "ducjs/legacy/v1/utils/elements/linearElement";
6
- import { SupportedMeasures } from "ducjs/legacy/v1/utils/scopes";
1
+ import { DucState, RawValue, Scope, ScopedValue } from "../../types";
2
+ import { DucElement, DucElementType, DucTextContainer, DucTextElement, DucTextElementWithContainer, ElementsMap, FontFamilyValues, FontString, NonDeletedDucElement } from "../../types/elements";
3
+ import { GeometricPoint } from "../../types/geometryTypes";
4
+ import { ExtractSetType } from "../../types/utility-types";
5
+ import { getBoundTextElementPosition } from "./linearElement";
6
+ import { SupportedMeasures } from "../scopes";
7
7
  export declare const computeBoundTextPosition: (container: DucElement, boundTextElement: DucTextElementWithContainer, elementsMap: ElementsMap, currentScope: SupportedMeasures) => {
8
8
  x: ScopedValue;
9
9
  y: ScopedValue;
@@ -34,7 +34,7 @@ export declare const getContainerCoords: (container: NonDeletedDucElement) => {
34
34
  x: RawValue;
35
35
  y: RawValue;
36
36
  };
37
- export declare const getTextElementAngle: (textElement: DucTextElement, container: DucTextContainer | null) => import("ducjs/legacy/v1/types/geometryTypes").Radian;
37
+ export declare const getTextElementAngle: (textElement: DucTextElement, container: DucTextContainer | null) => import("../../types/geometryTypes").Radian;
38
38
  export declare const shouldAllowVerticalAlign: (selectedElements: NonDeletedDucElement[], elementsMap: ElementsMap) => boolean;
39
39
  export declare const suppportsHorizontalAlign: (selectedElements: NonDeletedDucElement[], elementsMap: ElementsMap) => boolean;
40
40
  declare const VALID_CONTAINER_TYPES: Set<string>;
@@ -1,10 +1,10 @@
1
- import { isArrowElement, isBoundToContainer, isTextElement } from "ducjs/legacy/v1/types/elements/typeChecks";
2
- import { getContainerElement, getElementAbsoluteCoords, getResizedElementAbsoluteCoords } from "ducjs/legacy/v1/utils/bounds";
3
- import { ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO, ARROW_LABEL_WIDTH_FRACTION, BOUND_TEXT_PADDING, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, FONT_FAMILY, TEXT_ALIGN, VERTICAL_ALIGN, WINDOWS_EMOJI_FALLBACK_FONT } from "ducjs/legacy/v1/utils/constants";
4
- import { getBoundTextElementPosition, getPointGlobalCoordinates, getPointsGlobalCoordinates, getSegmentMidPoint } from "ducjs/legacy/v1/utils/elements/linearElement";
5
- import { adjustXYWithRotation } from "ducjs/legacy/v1/utils/math";
6
- import { normalizeText } from "ducjs/legacy/v1/utils/normalize";
7
- import { getPrecisionValueFromRaw, getScopedBezierPointFromDucPoint } from "ducjs/legacy/v1/utils/scopes";
1
+ import { isArrowElement, isBoundToContainer, isTextElement } from "../../types/elements/typeChecks";
2
+ import { getContainerElement, getElementAbsoluteCoords, getResizedElementAbsoluteCoords } from "../bounds";
3
+ import { ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO, ARROW_LABEL_WIDTH_FRACTION, BOUND_TEXT_PADDING, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, FONT_FAMILY, TEXT_ALIGN, VERTICAL_ALIGN, WINDOWS_EMOJI_FALLBACK_FONT } from "../constants";
4
+ import { getBoundTextElementPosition, getPointGlobalCoordinates, getPointsGlobalCoordinates, getSegmentMidPoint } from "./linearElement";
5
+ import { adjustXYWithRotation } from "../math";
6
+ import { normalizeText } from "../normalize";
7
+ import { getPrecisionValueFromRaw, getScopedBezierPointFromDucPoint } from "../scopes";
8
8
  export const computeBoundTextPosition = (container, boundTextElement, elementsMap, currentScope) => {
9
9
  if (isArrowElement(container)) {
10
10
  const coords = getBoundTextElementPosition(container, boundTextElement, elementsMap, currentScope);
@@ -1,4 +1,4 @@
1
- import { ActiveTool, DucState, ToolType } from "ducjs/legacy/v1/types";
1
+ import { ActiveTool, DucState, ToolType } from "../types";
2
2
  /**
3
3
  * supply `null` as message if non-never value is valid, you just need to
4
4
  * typecheck against it
@@ -1,4 +1,4 @@
1
- import type { Line, Direction, Point } from "ducjs/legacy/v1/utils/math/algebra/ga";
1
+ import type { Line, Direction, Point } from "./ga";
2
2
  /**
3
3
  * A direction is stored as an array `[0, 0, 0, 0, y, x, 0, 0]` representing
4
4
  * vector `(x, y)`.
@@ -1,4 +1,4 @@
1
- import * as GA from "ducjs/legacy/v1/utils/math/algebra/ga";
1
+ import * as GA from "./ga";
2
2
  /**
3
3
  * A direction is stored as an array `[0, 0, 0, 0, y, x, 0, 0]` representing
4
4
  * vector `(x, y)`.
@@ -1,4 +1,4 @@
1
- import type { Line, Point } from "ducjs/legacy/v1/utils/math/algebra/ga";
1
+ import type { Line, Point } from "./ga";
2
2
  /**
3
3
  * A line is stored as an array `[0, c, a, b, 0, 0, 0, 0]` representing:
4
4
  * c * e0 + a * e1 + b*e2