@oh-just-another/editor 0.61.1 → 0.62.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.
- package/CHANGELOG.md +125 -0
- package/README.md +18 -15
- package/dist/.tsbuildinfo +1 -1
- package/dist/Diagram.d.ts +22 -1
- package/dist/Diagram.d.ts.map +1 -1
- package/dist/Diagram.js +151 -114
- package/dist/Diagram.js.map +1 -1
- package/dist/brand/brand-logo.d.ts +11 -0
- package/dist/brand/brand-logo.d.ts.map +1 -0
- package/dist/brand/brand-logo.js +11 -0
- package/dist/brand/brand-logo.js.map +1 -0
- package/dist/brand/logo.generated.d.ts +4 -0
- package/dist/brand/logo.generated.d.ts.map +1 -0
- package/dist/brand/logo.generated.js +5 -0
- package/dist/brand/logo.generated.js.map +1 -0
- package/dist/file-actions.d.ts +38 -7
- package/dist/file-actions.d.ts.map +1 -1
- package/dist/file-actions.js +167 -17
- package/dist/file-actions.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/png-export.d.ts +7 -1
- package/dist/png-export.d.ts.map +1 -1
- package/dist/png-export.js +13 -49
- package/dist/png-export.js.map +1 -1
- package/dist/preferences-storage.d.ts +18 -0
- package/dist/preferences-storage.d.ts.map +1 -0
- package/dist/preferences-storage.js +63 -0
- package/dist/preferences-storage.js.map +1 -0
- package/dist/scene-subset.d.ts +20 -0
- package/dist/scene-subset.d.ts.map +1 -0
- package/dist/scene-subset.js +68 -0
- package/dist/scene-subset.js.map +1 -0
- package/package.json +16 -14
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,OAAO,EACP,KAAK,UAAU,IAAI,SA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AoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,YAAY,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -22,10 +22,11 @@ export { detectCapabilities, logCapabilities, } from "./capabilities.js";
|
|
|
22
22
|
export { isEditableTarget } from "./dom-focus.js";
|
|
23
23
|
export { bindEditorHotkeys } from "@oh-just-another/state";
|
|
24
24
|
export { exportSceneToPng } from "./png-export.js";
|
|
25
|
+
export { subsetScene, sceneBounds, fitViewportTo } from "./scene-subset.js";
|
|
25
26
|
// File operations (Save / Open / Export / Copy-as-image) — registered on
|
|
26
27
|
// the action registry by `<Editor>`; exported so hosts can wire them to
|
|
27
28
|
// their own chrome or a custom registry.
|
|
28
|
-
export { fileActions, registerFileActions, setFileActionNotifier, downloadScene, downloadSvg, downloadPng, openSceneFile, copySceneAsImage, } from "./file-actions.js";
|
|
29
|
+
export { fileActions, registerFileActions, setFileActionNotifier, downloadScene, downloadSvg, downloadPng, openSceneFile, copySceneAsImage, copySelectionAsPng, copySelectionAsSvg, copySelectionAsText, sceneToSvgMarkup, selectionText, } from "./file-actions.js";
|
|
29
30
|
// Plug-in registries from the underlying packages, surfaced here so the
|
|
30
31
|
// umbrella package is the single import for extending the editor without
|
|
31
32
|
// reaching into the lower-level packages.
|
|
@@ -41,4 +42,6 @@ export { defineShape } from "./define-shape.js";
|
|
|
41
42
|
export { installGifAnimationAdapter } from "./gif-animation.js";
|
|
42
43
|
// Tool operations + types (eyedropper / convert-type / image-crop / spawn).
|
|
43
44
|
export { clampCrop, computeConvertType, computeSetImageCrop, computeCommitImageCrop, computeSpawnConnectedNode, cropFullImageLocalRect, cropHandleWorldPoints, computeCropHandleDrag, computeCropBodyPan, CROP_HANDLES, FULL_CROP, pickColorAt, } from "@oh-just-another/state";
|
|
45
|
+
export { DEFAULT_PREFERENCES_STORAGE_KEY, bindPreferencesPersistence, loadPreferences, parseStoredPreferences, } from "./preferences-storage.js";
|
|
46
|
+
export { BrandLogo } from "./brand/brand-logo.js";
|
|
44
47
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,OAAO,GAOR,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,eAAe,GAGhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAA6B,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,iBAAiB,CAAC;AACpG,yEAAyE;AACzE,wEAAwE;AACxE,yCAAyC;AACzC,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,OAAO,GAOR,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,eAAe,GAGhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAA6B,MAA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-export.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Scene } from "@oh-just-another/scene";
|
|
2
|
+
import { type RenderSceneOptions } from "@oh-just-another/renderer-core";
|
|
2
3
|
/**
|
|
3
4
|
* Browser-side PNG export — renders the **full scene** (not just the
|
|
4
5
|
* current viewport) into an OffscreenCanvas via the `renderScene` +
|
|
@@ -25,6 +26,11 @@ export interface PngExportOptions {
|
|
|
25
26
|
* `--du-canvas-bg` CSS variable so the PNG matches what the user sees.
|
|
26
27
|
*/
|
|
27
28
|
readonly backgroundColor: string;
|
|
29
|
+
/**
|
|
30
|
+
* Content switches for meta layers (sticky reactions / tags / author).
|
|
31
|
+
* Merged over {@link EXPORT_CONTENT_DEFAULTS}; omit for the defaults.
|
|
32
|
+
*/
|
|
33
|
+
readonly content?: RenderSceneOptions["content"];
|
|
28
34
|
}
|
|
29
35
|
export declare const exportSceneToPng: (scene: Scene, options: PngExportOptions) => Promise<Blob | null>;
|
|
30
36
|
//# sourceMappingURL=png-export.d.ts.map
|
package/dist/png-export.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"png-export.d.ts","sourceRoot":"","sources":["../src/png-export.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"png-export.d.ts","sourceRoot":"","sources":["../src/png-export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,gCAAgC,CAAC;AAIxC;;;;;;;;;;;;;GAaG;AAEH,4DAA4D;AAC5D,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,OAAO,GAAG,gBAAgB,CAAC;AAE7E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,gBAAgB,GAC3B,OAAO,KAAK,EACZ,SAAS,gBAAgB,KACxB,OAAO,CAAC,IAAI,GAAG,IAAI,CAwCrB,CAAC"}
|
package/dist/png-export.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { renderLinks, renderGrid, renderScene } from "@oh-just-another/renderer-core";
|
|
1
|
+
import { renderLinks, renderGrid, renderScene, EXPORT_CONTENT_DEFAULTS, } from "@oh-just-another/renderer-core";
|
|
3
2
|
import { createOffscreenCanvas2DTarget } from "@oh-just-another/renderer-canvas";
|
|
4
|
-
import {
|
|
3
|
+
import { fitViewportTo, sceneBounds } from "./scene-subset.js";
|
|
5
4
|
export const exportSceneToPng = async (scene, options) => {
|
|
6
5
|
if (typeof OffscreenCanvas === "undefined")
|
|
7
6
|
return null;
|
|
8
|
-
const bbox =
|
|
7
|
+
const bbox = sceneBounds(scene);
|
|
9
8
|
if (!bbox)
|
|
10
9
|
return null; // empty scene — host shows an alert
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const canvasW = Math.max(1, Math.ceil(padded.width * options.scale));
|
|
18
|
-
const canvasH = Math.max(1, Math.ceil(padded.height * options.scale));
|
|
10
|
+
// Synthesise a viewport that maps the padded world bbox onto the
|
|
11
|
+
// OffscreenCanvas backbuffer at the requested scale.
|
|
12
|
+
const fitted = fitViewportTo(scene, bbox, options.scale);
|
|
13
|
+
const canvasW = fitted.width;
|
|
14
|
+
const canvasH = fitted.height;
|
|
15
|
+
const exportScene = fitted.scene;
|
|
19
16
|
const { canvas, target } = createOffscreenCanvas2DTarget(canvasW, canvasH);
|
|
20
17
|
// Background fill via the kernel target before shapes render (with
|
|
21
18
|
// skipClear so the fill survives the renderScene pass). Drawing
|
|
@@ -27,50 +24,17 @@ export const exportSceneToPng = async (scene, options) => {
|
|
|
27
24
|
target.rect(0, 0, canvasW, canvasH);
|
|
28
25
|
target.fill();
|
|
29
26
|
}
|
|
30
|
-
// Synthesise a viewport that maps the padded world bbox onto the
|
|
31
|
-
// OffscreenCanvas backbuffer at the requested scale.
|
|
32
|
-
// `pan = (padded.x, padded.y)` → world origin pixel (0, 0).
|
|
33
|
-
// `zoom = scale` → world unit covers `scale` device pixels.
|
|
34
|
-
// `size = canvasW × canvasH` → renderers see the full backbuffer.
|
|
35
|
-
const exportScene = {
|
|
36
|
-
...scene,
|
|
37
|
-
viewport: {
|
|
38
|
-
pan: { x: padded.x, y: padded.y },
|
|
39
|
-
zoom: options.scale,
|
|
40
|
-
rotation: 0,
|
|
41
|
-
size: { width: canvasW, height: canvasH },
|
|
42
|
-
gridEnabled: scene.viewport.gridEnabled,
|
|
43
|
-
...(scene.viewport.gridStyle !== undefined ? { gridStyle: scene.viewport.gridStyle } : {}),
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
27
|
// Grid pass — only for the color-and-grid variant, and only when the scene
|
|
47
28
|
// has the grid enabled.
|
|
48
29
|
if (options.background === "color-and-grid" && exportScene.viewport.gridEnabled) {
|
|
49
30
|
renderGrid(exportScene, target);
|
|
50
31
|
}
|
|
51
32
|
// Shapes (skipClear: true so background / grid survive).
|
|
52
|
-
renderScene(exportScene, target, {
|
|
33
|
+
renderScene(exportScene, target, {
|
|
34
|
+
skipClear: true,
|
|
35
|
+
content: { ...EXPORT_CONTENT_DEFAULTS, ...options.content },
|
|
36
|
+
});
|
|
53
37
|
renderLinks(exportScene, target);
|
|
54
38
|
return canvas.convertToBlob({ type: "image/png" });
|
|
55
39
|
};
|
|
56
|
-
const computeSceneBbox = (scene) => {
|
|
57
|
-
let acc = null;
|
|
58
|
-
for (const layer of getLayersInOrder(scene)) {
|
|
59
|
-
if (!layer.visible)
|
|
60
|
-
continue;
|
|
61
|
-
for (const shape of getElementsInLayer(scene, layer.id)) {
|
|
62
|
-
const b = getElementWorldBounds(shape);
|
|
63
|
-
acc = acc ? unionBounds(acc, b) : b;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return acc;
|
|
67
|
-
};
|
|
68
|
-
/** Inlined AABB union — avoids pulling `@math` into the host package. */
|
|
69
|
-
const unionBounds = (a, b) => {
|
|
70
|
-
const x = Math.min(a.x, b.x);
|
|
71
|
-
const y = Math.min(a.y, b.y);
|
|
72
|
-
const right = Math.max(a.x + a.width, b.x + b.width);
|
|
73
|
-
const bottom = Math.max(a.y + a.height, b.y + b.height);
|
|
74
|
-
return { x, y, width: right - x, height: bottom - y };
|
|
75
|
-
};
|
|
76
40
|
//# sourceMappingURL=png-export.js.map
|
package/dist/png-export.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"png-export.js","sourceRoot":"","sources":["../src/png-export.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"png-export.js","sourceRoot":"","sources":["../src/png-export.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,uBAAuB,GAExB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAqC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACnC,KAAY,EACZ,OAAyB,EACH,EAAE;IACxB,IAAI,OAAO,eAAe,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAExD,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,CAAC,oCAAoC;IAE5D,iEAAiE;IACjE,qDAAqD;IACrD,MAAM,MAAM,GAAG,a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|
+
/** Default `localStorage` key for `<Diagram persistPreferences>`. */
|
|
3
|
+
export declare const DEFAULT_PREFERENCES_STORAGE_KEY = "diagram-preferences";
|
|
4
|
+
/**
|
|
5
|
+
* Parse a stored preferences blob, keeping only known keys with valid
|
|
6
|
+
* values so a stale / hand-edited entry can never poison the editor.
|
|
7
|
+
*/
|
|
8
|
+
export declare const parseStoredPreferences: (raw: string | null) => Partial<EditorPreferences>;
|
|
9
|
+
/** Read the persisted preferences (missing / invalid → `{}`). */
|
|
10
|
+
export declare const loadPreferences: (key: string) => Partial<EditorPreferences>;
|
|
11
|
+
/**
|
|
12
|
+
* Apply the persisted preferences to `editor` and write every later change
|
|
13
|
+
* back under `key`. Returns the unsubscribe function. Storage errors
|
|
14
|
+
* (private mode, quota) are swallowed — preferences then live for the
|
|
15
|
+
* session only.
|
|
16
|
+
*/
|
|
17
|
+
export declare const bindPreferencesPersistence: (editor: Editor, key: string) => (() => void);
|
|
18
|
+
//# sourceMappingURL=preferences-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preferences-storage.d.ts","sourceRoot":"","sources":["../src/preferences-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,iBAAiB,EAEvB,MAAM,wBAAwB,CAAC;AAEhC,qEAAqE;AACrE,eAAO,MAAM,+BAA+B,wBAAwB,CAAC;AAIrE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,MAAM,GAAG,IAAI,KAAG,OAAO,CAAC,iBAAiB,CAgBpF,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,OAAO,CAAC,iBAAiB,CAOtE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GAAI,QAAQ,MAAM,EAAE,KAAK,MAAM,KAAG,CAAC,MAAM,IAAI,CAYnF,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { DEFAULT_EDITOR_PREFERENCES, } from "@oh-just-another/state";
|
|
2
|
+
/** Default `localStorage` key for `<Diagram persistPreferences>`. */
|
|
3
|
+
export const DEFAULT_PREFERENCES_STORAGE_KEY = "diagram-preferences";
|
|
4
|
+
const WHEEL_MODES = ["auto", "mouse", "trackpad"];
|
|
5
|
+
/**
|
|
6
|
+
* Parse a stored preferences blob, keeping only known keys with valid
|
|
7
|
+
* values so a stale / hand-edited entry can never poison the editor.
|
|
8
|
+
*/
|
|
9
|
+
export const parseStoredPreferences = (raw) => {
|
|
10
|
+
if (!raw)
|
|
11
|
+
return {};
|
|
12
|
+
let data;
|
|
13
|
+
try {
|
|
14
|
+
data = JSON.parse(raw);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
if (typeof data !== "object" || data === null)
|
|
20
|
+
return {};
|
|
21
|
+
const o = data;
|
|
22
|
+
const out = {};
|
|
23
|
+
for (const key of ["snapObjects", "showObjectSize", "suggestObjectSize"]) {
|
|
24
|
+
if (typeof o[key] === "boolean")
|
|
25
|
+
out[key] = o[key];
|
|
26
|
+
}
|
|
27
|
+
if (WHEEL_MODES.includes(o.wheelMode))
|
|
28
|
+
out.wheelMode = o.wheelMode;
|
|
29
|
+
return out;
|
|
30
|
+
};
|
|
31
|
+
/** Read the persisted preferences (missing / invalid → `{}`). */
|
|
32
|
+
export const loadPreferences = (key) => {
|
|
33
|
+
if (typeof window === "undefined")
|
|
34
|
+
return {};
|
|
35
|
+
try {
|
|
36
|
+
return parseStoredPreferences(window.localStorage.getItem(key));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return {};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Apply the persisted preferences to `editor` and write every later change
|
|
44
|
+
* back under `key`. Returns the unsubscribe function. Storage errors
|
|
45
|
+
* (private mode, quota) are swallowed — preferences then live for the
|
|
46
|
+
* session only.
|
|
47
|
+
*/
|
|
48
|
+
export const bindPreferencesPersistence = (editor, key) => {
|
|
49
|
+
editor.setPreferences({ ...DEFAULT_EDITOR_PREFERENCES, ...loadPreferences(key) });
|
|
50
|
+
let last = editor.preferences;
|
|
51
|
+
return editor.subscribe(() => {
|
|
52
|
+
if (editor.preferences === last)
|
|
53
|
+
return;
|
|
54
|
+
last = editor.preferences;
|
|
55
|
+
try {
|
|
56
|
+
window.localStorage.setItem(key, JSON.stringify(last));
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Best effort — see the doc comment.
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=preferences-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preferences-storage.js","sourceRoot":"","sources":["../src/preferences-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,GAI3B,MAAM,wBAAwB,CAAC;AAEhC,qEAAqE;AACrE,MAAM,CAAC,MAAM,+BAA+B,GAAG,qBAAqB,CAAC;AAErE,MAAM,WAAW,GAAyB,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAExE;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAkB,EAA8B,EAAE;IACvF,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,IAAI,IAAa,CAAC;IAClB,IAAI,CAAC;QACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IACzD,MAAM,CAAC,GAAG,IAA+B,CAAC;IAC1C,MAAM,GAAG,GAAwE,EAAE,CAAC;IACpF,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAA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C,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Scene } from "@oh-just-another/scene";
|
|
2
|
+
import type { Bounds, ElementId } from "@oh-just-another/types";
|
|
3
|
+
/**
|
|
4
|
+
* The scene reduced to `ids` (plus the links bound on both ends to them),
|
|
5
|
+
* for selection-scoped exports. Layers / files / viewport are kept.
|
|
6
|
+
*/
|
|
7
|
+
export declare const subsetScene: (scene: Scene, ids: ReadonlySet<ElementId>) => Scene;
|
|
8
|
+
/** World AABB of every element on a visible layer, or `null` when empty. */
|
|
9
|
+
export declare const sceneBounds: (scene: Scene) => Bounds | null;
|
|
10
|
+
/**
|
|
11
|
+
* Camera that maps `bbox` (padded by `EXPORT_PADDING_WORLD`) onto a
|
|
12
|
+
* `scale`-times backbuffer: `pan` = padded origin, `zoom` = scale, `size`
|
|
13
|
+
* = padded size × scale. Grid settings carry over from the source scene.
|
|
14
|
+
*/
|
|
15
|
+
export declare const fitViewportTo: (scene: Scene, bbox: Bounds, scale: number) => {
|
|
16
|
+
readonly scene: Scene;
|
|
17
|
+
readonly width: number;
|
|
18
|
+
readonly height: number;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=scene-subset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-subset.d.ts","sourceRoot":"","sources":["../src/scene-subset.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,KAAK,EACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGhE;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,EAAE,KAAK,WAAW,CAAC,SAAS,CAAC,KAAG,KAYvE,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,KAAG,MAAM,GAAG,IAUnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,KAAK,EACZ,MAAM,MAAM,EACZ,OAAO,MAAM,KACZ;IAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAwB1E,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getElementWorldBounds, getElementsInLayer, getLayersInOrder, } from "@oh-just-another/scene";
|
|
2
|
+
import { EXPORT_PADDING_WORLD } from "./constants.js";
|
|
3
|
+
/**
|
|
4
|
+
* The scene reduced to `ids` (plus the links bound on both ends to them),
|
|
5
|
+
* for selection-scoped exports. Layers / files / viewport are kept.
|
|
6
|
+
*/
|
|
7
|
+
export const subsetScene = (scene, ids) => {
|
|
8
|
+
const elements = new Map([...scene.elements].filter(([id]) => ids.has(id)));
|
|
9
|
+
const bound = (end) => end.kind === "point" ? null : end.elementId;
|
|
10
|
+
const inside = (end) => {
|
|
11
|
+
const id = bound(end);
|
|
12
|
+
return id === null || ids.has(id);
|
|
13
|
+
};
|
|
14
|
+
const links = new Map([...scene.links].filter(([, link]) => inside(link.from) && inside(link.to)));
|
|
15
|
+
return { ...scene, elements, links };
|
|
16
|
+
};
|
|
17
|
+
/** World AABB of every element on a visible layer, or `null` when empty. */
|
|
18
|
+
export const sceneBounds = (scene) => {
|
|
19
|
+
let acc = null;
|
|
20
|
+
for (const layer of getLayersInOrder(scene)) {
|
|
21
|
+
if (!layer.visible)
|
|
22
|
+
continue;
|
|
23
|
+
for (const shape of getElementsInLayer(scene, layer.id)) {
|
|
24
|
+
const b = getElementWorldBounds(shape);
|
|
25
|
+
acc = acc ? unionBounds(acc, b) : b;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return acc;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Camera that maps `bbox` (padded by `EXPORT_PADDING_WORLD`) onto a
|
|
32
|
+
* `scale`-times backbuffer: `pan` = padded origin, `zoom` = scale, `size`
|
|
33
|
+
* = padded size × scale. Grid settings carry over from the source scene.
|
|
34
|
+
*/
|
|
35
|
+
export const fitViewportTo = (scene, bbox, scale) => {
|
|
36
|
+
const padded = {
|
|
37
|
+
x: bbox.x - EXPORT_PADDING_WORLD,
|
|
38
|
+
y: bbox.y - EXPORT_PADDING_WORLD,
|
|
39
|
+
width: bbox.width + 2 * EXPORT_PADDING_WORLD,
|
|
40
|
+
height: bbox.height + 2 * EXPORT_PADDING_WORLD,
|
|
41
|
+
};
|
|
42
|
+
const width = Math.max(1, Math.ceil(padded.width * scale));
|
|
43
|
+
const height = Math.max(1, Math.ceil(padded.height * scale));
|
|
44
|
+
return {
|
|
45
|
+
width,
|
|
46
|
+
height,
|
|
47
|
+
scene: {
|
|
48
|
+
...scene,
|
|
49
|
+
viewport: {
|
|
50
|
+
pan: { x: padded.x, y: padded.y },
|
|
51
|
+
zoom: scale,
|
|
52
|
+
rotation: 0,
|
|
53
|
+
size: { width, height },
|
|
54
|
+
gridEnabled: scene.viewport.gridEnabled,
|
|
55
|
+
...(scene.viewport.gridStyle !== undefined ? { gridStyle: scene.viewport.gridStyle } : {}),
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/** Inlined AABB union — avoids pulling `@math` into the host package. */
|
|
61
|
+
const unionBounds = (a, b) => {
|
|
62
|
+
const x = Math.min(a.x, b.x);
|
|
63
|
+
const y = Math.min(a.y, b.y);
|
|
64
|
+
const right = Math.max(a.x + a.width, b.x + b.width);
|
|
65
|
+
const bottom = Math.max(a.y + a.height, b.y + b.height);
|
|
66
|
+
return { x, y, width: right - x, height: bottom - y };
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=scene-subset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-subset.js","sourceRoot":"","sources":["../src/scene-subset.ts"],"names":[],"mappings":"AAAA,OAAO,E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or as a single React component. Auto-detects renderer / WASM / worker capabilities and exposes a programmatic editor API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Rustam Garifulin <rustam@n69.in>",
|
|
@@ -42,17 +42,18 @@
|
|
|
42
42
|
"gifuct-js": "2.1.2",
|
|
43
43
|
"lucide-react": "1.16.0",
|
|
44
44
|
"@oh-just-another/fonts": "0.1.0",
|
|
45
|
-
"@oh-just-another/raster-wasm": "0.57.
|
|
46
|
-
"@oh-just-another/react-ui": "0.
|
|
47
|
-
"@oh-just-another/renderer-canvas": "0.
|
|
48
|
-
"@oh-just-another/renderer-core": "0.
|
|
49
|
-
"@oh-just-another/renderer-svg": "0.
|
|
50
|
-
"@oh-just-another/scene": "0.
|
|
51
|
-
"@oh-just-another/serialization": "0.
|
|
52
|
-
"@oh-just-another/state": "0.
|
|
53
|
-
"@oh-just-another/templates": "0.
|
|
54
|
-
"@oh-just-another/text-wasm": "0.57.
|
|
55
|
-
"@oh-just-another/types": "0.57.0"
|
|
45
|
+
"@oh-just-another/raster-wasm": "0.57.6",
|
|
46
|
+
"@oh-just-another/react-ui": "0.62.0",
|
|
47
|
+
"@oh-just-another/renderer-canvas": "0.62.0",
|
|
48
|
+
"@oh-just-another/renderer-core": "0.61.0",
|
|
49
|
+
"@oh-just-another/renderer-svg": "0.58.0",
|
|
50
|
+
"@oh-just-another/scene": "0.62.0",
|
|
51
|
+
"@oh-just-another/serialization": "0.61.0",
|
|
52
|
+
"@oh-just-another/state": "0.63.0",
|
|
53
|
+
"@oh-just-another/templates": "0.58.0",
|
|
54
|
+
"@oh-just-another/text-wasm": "0.57.6",
|
|
55
|
+
"@oh-just-another/types": "0.57.0",
|
|
56
|
+
"@oh-just-another/importers": "0.60.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"react": ">=18",
|
|
@@ -67,11 +68,12 @@
|
|
|
67
68
|
"react-dom": "19.2.6"
|
|
68
69
|
},
|
|
69
70
|
"scripts": {
|
|
70
|
-
"build": "tsc -b tsconfig.build.json",
|
|
71
|
+
"build": "pnpm gen:logo && tsc -b tsconfig.build.json",
|
|
71
72
|
"typecheck": "tsc --noEmit",
|
|
72
73
|
"test": "vitest run",
|
|
73
74
|
"test:watch": "vitest",
|
|
74
75
|
"lint": "eslint src tests",
|
|
75
|
-
"clean": "rm -rf dist *.tsbuildinfo"
|
|
76
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
77
|
+
"gen:logo": "node scripts/gen-logo.mjs"
|
|
76
78
|
}
|
|
77
79
|
}
|