pptx-svelte-viewer 3.22.0 → 4.1.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 +28 -0
- package/README.md +9 -0
- package/dist/{AiChatPanel-BVxOdrTN.js → AiChatPanel-B3SDtN1C.js} +65 -65
- package/dist/canvas_emf-converter-CKs-EBwD.js +5 -0
- package/dist/{export-CXDSKwGo.js → export-gq-uU4it.js} +9702 -9586
- package/dist/i18n/de.cjs +2 -0
- package/dist/i18n/de.mjs +2 -0
- package/dist/i18n/es.cjs +2 -0
- package/dist/i18n/es.mjs +2 -0
- package/dist/i18n/fr.cjs +2 -0
- package/dist/i18n/fr.mjs +2 -0
- package/dist/i18n/zh-CN.cjs +2 -0
- package/dist/i18n/zh-CN.mjs +2 -0
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +52 -2
- package/dist/index.js +34 -33
- package/dist/internals.js +16 -16
- package/dist/smartart-3d-D1MLYTBe.js +290 -0
- package/dist/{transition-overlay-Cs0NYacO.js → transition-overlay-Dvef1UAZ.js} +35011 -33897
- package/dist/{translator-DYwn0WKw.js → translator-D7duxy6A.js} +2 -0
- package/dist/viewer/index.d.ts +152 -24
- package/dist/viewer/index.js +24 -21
- package/package.json +2 -2
- package/dist/smartart-3d-Btipz914.js +0 -213
package/dist/i18n/de.cjs
CHANGED
|
@@ -1367,6 +1367,8 @@ var translations8 = {
|
|
|
1367
1367
|
"pptx.collaboration.userCount": "{{count}} Nutzer",
|
|
1368
1368
|
"pptx.collaboration.youLabel": "{{name}} (Sie)",
|
|
1369
1369
|
"pptx.collaboration.usersConnected": "{{count}} verbundener Nutzer",
|
|
1370
|
+
"pptx.collaboration.editable": "Bearbeitbar",
|
|
1371
|
+
"pptx.collaboration.shellStatusLabel": "Status der Zusammenarbeit",
|
|
1370
1372
|
"pptx.collaboration.moreUsers": "{{count}} weitere Nutzer",
|
|
1371
1373
|
"pptx.collaboration.onePersonHere": "1 Person hier",
|
|
1372
1374
|
"pptx.collaboration.peopleHere": "{{count}} Leute hier",
|
package/dist/i18n/de.mjs
CHANGED
|
@@ -1341,6 +1341,8 @@ var translations8 = {
|
|
|
1341
1341
|
"pptx.collaboration.userCount": "{{count}} Nutzer",
|
|
1342
1342
|
"pptx.collaboration.youLabel": "{{name}} (Sie)",
|
|
1343
1343
|
"pptx.collaboration.usersConnected": "{{count}} verbundener Nutzer",
|
|
1344
|
+
"pptx.collaboration.editable": "Bearbeitbar",
|
|
1345
|
+
"pptx.collaboration.shellStatusLabel": "Status der Zusammenarbeit",
|
|
1344
1346
|
"pptx.collaboration.moreUsers": "{{count}} weitere Nutzer",
|
|
1345
1347
|
"pptx.collaboration.onePersonHere": "1 Person hier",
|
|
1346
1348
|
"pptx.collaboration.peopleHere": "{{count}} Leute hier",
|
package/dist/i18n/es.cjs
CHANGED
|
@@ -1367,6 +1367,8 @@ var translations8 = {
|
|
|
1367
1367
|
"pptx.collaboration.userCount": "{{count}} usuario(s)",
|
|
1368
1368
|
"pptx.collaboration.youLabel": "{{name}} (t\xFA)",
|
|
1369
1369
|
"pptx.collaboration.usersConnected": "{{count}} usuario(s) conectado(s)",
|
|
1370
|
+
"pptx.collaboration.editable": "Editable",
|
|
1371
|
+
"pptx.collaboration.shellStatusLabel": "Estado de la colaboraci\xF3n",
|
|
1370
1372
|
"pptx.collaboration.moreUsers": "{{count}} usuario(s) m\xE1s",
|
|
1371
1373
|
"pptx.collaboration.onePersonHere": "1 persona aqu\xED",
|
|
1372
1374
|
"pptx.collaboration.peopleHere": "{{count}} gente aqu\xED",
|
package/dist/i18n/es.mjs
CHANGED
|
@@ -1341,6 +1341,8 @@ var translations8 = {
|
|
|
1341
1341
|
"pptx.collaboration.userCount": "{{count}} usuario(s)",
|
|
1342
1342
|
"pptx.collaboration.youLabel": "{{name}} (t\xFA)",
|
|
1343
1343
|
"pptx.collaboration.usersConnected": "{{count}} usuario(s) conectado(s)",
|
|
1344
|
+
"pptx.collaboration.editable": "Editable",
|
|
1345
|
+
"pptx.collaboration.shellStatusLabel": "Estado de la colaboraci\xF3n",
|
|
1344
1346
|
"pptx.collaboration.moreUsers": "{{count}} usuario(s) m\xE1s",
|
|
1345
1347
|
"pptx.collaboration.onePersonHere": "1 persona aqu\xED",
|
|
1346
1348
|
"pptx.collaboration.peopleHere": "{{count}} gente aqu\xED",
|
package/dist/i18n/fr.cjs
CHANGED
|
@@ -1367,6 +1367,8 @@ var translations8 = {
|
|
|
1367
1367
|
"pptx.collaboration.userCount": "{{count}} utilisateur(s)",
|
|
1368
1368
|
"pptx.collaboration.youLabel": "{{name}} (vous)",
|
|
1369
1369
|
"pptx.collaboration.usersConnected": "{{count}} utilisateur(s) connect\xE9(s)",
|
|
1370
|
+
"pptx.collaboration.editable": "Modifiable",
|
|
1371
|
+
"pptx.collaboration.shellStatusLabel": "\xC9tat de la collaboration",
|
|
1370
1372
|
"pptx.collaboration.moreUsers": "{{count}} utilisateur(s) suppl\xE9mentaire(s)",
|
|
1371
1373
|
"pptx.collaboration.onePersonHere": "1 personne ici",
|
|
1372
1374
|
"pptx.collaboration.peopleHere": "Personnes {{count}} ici",
|
package/dist/i18n/fr.mjs
CHANGED
|
@@ -1341,6 +1341,8 @@ var translations8 = {
|
|
|
1341
1341
|
"pptx.collaboration.userCount": "{{count}} utilisateur(s)",
|
|
1342
1342
|
"pptx.collaboration.youLabel": "{{name}} (vous)",
|
|
1343
1343
|
"pptx.collaboration.usersConnected": "{{count}} utilisateur(s) connect\xE9(s)",
|
|
1344
|
+
"pptx.collaboration.editable": "Modifiable",
|
|
1345
|
+
"pptx.collaboration.shellStatusLabel": "\xC9tat de la collaboration",
|
|
1344
1346
|
"pptx.collaboration.moreUsers": "{{count}} utilisateur(s) suppl\xE9mentaire(s)",
|
|
1345
1347
|
"pptx.collaboration.onePersonHere": "1 personne ici",
|
|
1346
1348
|
"pptx.collaboration.peopleHere": "Personnes {{count}} ici",
|
package/dist/i18n/zh-CN.cjs
CHANGED
|
@@ -1411,6 +1411,8 @@ var translations11 = {
|
|
|
1411
1411
|
"pptx.collaboration.userCount": "{{count}} \u4F4D\u7528\u6237",
|
|
1412
1412
|
"pptx.collaboration.youLabel": "{{name}}\uFF08\u4F60\uFF09",
|
|
1413
1413
|
"pptx.collaboration.usersConnected": "\u5DF2\u8FDE\u63A5 {{count}} \u4F4D\u7528\u6237",
|
|
1414
|
+
"pptx.collaboration.editable": "\u53EF\u7F16\u8F91",
|
|
1415
|
+
"pptx.collaboration.shellStatusLabel": "\u534F\u4F5C\u72B6\u6001",
|
|
1414
1416
|
"pptx.collaboration.moreUsers": "\u8FD8\u6709 {{count}} \u4F4D\u7528\u6237",
|
|
1415
1417
|
"pptx.collaboration.onePersonHere": "\u8FD9\u91CC\u6709 1 \u4EBA",
|
|
1416
1418
|
"pptx.collaboration.peopleHere": "\u8FD9\u91CC\u6709 {{count}} \u4EBA",
|
package/dist/i18n/zh-CN.mjs
CHANGED
|
@@ -1385,6 +1385,8 @@ var translations11 = {
|
|
|
1385
1385
|
"pptx.collaboration.userCount": "{{count}} \u4F4D\u7528\u6237",
|
|
1386
1386
|
"pptx.collaboration.youLabel": "{{name}}\uFF08\u4F60\uFF09",
|
|
1387
1387
|
"pptx.collaboration.usersConnected": "\u5DF2\u8FDE\u63A5 {{count}} \u4F4D\u7528\u6237",
|
|
1388
|
+
"pptx.collaboration.editable": "\u53EF\u7F16\u8F91",
|
|
1389
|
+
"pptx.collaboration.shellStatusLabel": "\u534F\u4F5C\u72B6\u6001",
|
|
1388
1390
|
"pptx.collaboration.moreUsers": "\u8FD8\u6709 {{count}} \u4F4D\u7528\u6237",
|
|
1389
1391
|
"pptx.collaboration.onePersonHere": "\u8FD9\u91CC\u6709 1 \u4EBA",
|
|
1390
1392
|
"pptx.collaboration.peopleHere": "\u8FD9\u91CC\u6709 {{count}} \u4EBA",
|
package/dist/i18n.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -11618,6 +11618,38 @@ interface ThemeCatalogEntry {
|
|
|
11618
11618
|
//#region src/render/collaboration-presence.d.ts
|
|
11619
11619
|
/** Connection lifecycle states for the Yjs WebSocket provider. */
|
|
11620
11620
|
type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
11621
|
+
/** A single remote collaborator's cursor, in unscaled slide coordinates. */
|
|
11622
|
+
interface RemoteCursor {
|
|
11623
|
+
/** Stable id for the remote client (awareness clientId or peer id). */
|
|
11624
|
+
clientId: number | string;
|
|
11625
|
+
/** Display name shown in the label chip. */
|
|
11626
|
+
userName: string;
|
|
11627
|
+
/** Cursor + chip colour (any CSS colour string). */
|
|
11628
|
+
color: string;
|
|
11629
|
+
/** Unscaled slide-space X coordinate (px). */
|
|
11630
|
+
x: number;
|
|
11631
|
+
/** Unscaled slide-space Y coordinate (px). */
|
|
11632
|
+
y: number;
|
|
11633
|
+
/** Optional ids of elements this user has selected. */
|
|
11634
|
+
selectionIds?: string[];
|
|
11635
|
+
}
|
|
11636
|
+
/**
|
|
11637
|
+
* Presence data for a remote collaborator, sanitised from the awareness
|
|
11638
|
+
* protocol. Returned by {@link sanitizePresence}; coordinates are in unscaled
|
|
11639
|
+
* slide pixels, clamped to the supplied canvas bounds.
|
|
11640
|
+
*/
|
|
11641
|
+
interface SanitizedPresence {
|
|
11642
|
+
clientId: number;
|
|
11643
|
+
userName: string;
|
|
11644
|
+
userAvatar?: string;
|
|
11645
|
+
userColor: string;
|
|
11646
|
+
activeSlideIndex: number;
|
|
11647
|
+
cursorX: number;
|
|
11648
|
+
cursorY: number;
|
|
11649
|
+
lastUpdated: string;
|
|
11650
|
+
selectedElementId?: string;
|
|
11651
|
+
role?: CollaborationRole;
|
|
11652
|
+
}
|
|
11621
11653
|
//#endregion
|
|
11622
11654
|
//#region src/render/collaboration-presence-publisher.d.ts
|
|
11623
11655
|
/**
|
|
@@ -11865,6 +11897,24 @@ interface CollaborationConfig {
|
|
|
11865
11897
|
*/
|
|
11866
11898
|
writeBackDebounceMs?: number;
|
|
11867
11899
|
}
|
|
11900
|
+
interface CollaborationShellState {
|
|
11901
|
+
canEdit: boolean;
|
|
11902
|
+
status: ConnectionStatus;
|
|
11903
|
+
remoteUsers: readonly SanitizedPresence[];
|
|
11904
|
+
connectedCount: number;
|
|
11905
|
+
}
|
|
11906
|
+
type CollaborationShellTranslate = (key: string, params?: Record<string, string | number>) => string;
|
|
11907
|
+
/**
|
|
11908
|
+
* One-line, localised status for a custom shell's `role="status"` readout.
|
|
11909
|
+
*
|
|
11910
|
+
* Every binding's custom-shell demo renders this same string under the same
|
|
11911
|
+
* `Collaboration status` label, so the framework-neutral e2e helper that
|
|
11912
|
+
* waits for the shell to become editable (`waitForHostEditing`) reads every
|
|
11913
|
+
* binding the same way. Three of five demos once phrased it differently and
|
|
11914
|
+
* the helper silently skipped them; on vanilla, that let a peer double-click
|
|
11915
|
+
* before its edit gate opened.
|
|
11916
|
+
*/
|
|
11917
|
+
declare function describeCollaborationShellState(state: Pick<CollaborationShellState, 'canEdit' | 'status' | 'connectedCount'>, translate: CollaborationShellTranslate): string;
|
|
11868
11918
|
/**
|
|
11869
11919
|
* A font supplied by the host application. The package never ships fonts:
|
|
11870
11920
|
* applications provide a licensed URL, data URL, or blob URL for their users.
|
|
@@ -12899,5 +12949,5 @@ declare const PowerPointViewer: Component<PowerPointViewerProps, PowerPointViewe
|
|
|
12899
12949
|
*/
|
|
12900
12950
|
type AutosaveStatus = 'idle' | 'disabled' | 'saving' | 'saved' | 'error';
|
|
12901
12951
|
|
|
12902
|
-
export { PPTX_OPEN_ACCEPT, PRESENTATION_OPEN_EXTENSIONS, PowerPointViewer, createImageElementFromFile, defaultCssVars, defaultRadius, defaultThemeColors, deleteAutosaveSnapshot, exportAllSlidesToSvg, exportAllSlidesToSvgBlobs, exportSlideAsSvg, exportSlideToSvg, exportSlideToSvgBlob, forgetSessionDeck, getAutosaveSnapshot, getSessionTabId, isLegacyBinaryPresentation, isSupportedPresentationFile, listAutosaveSnapshots, loadPresentationDeck, loadSessionDeck, parsePresentationSessionId, presentationBaseName, registerTranslations, rememberSessionDeck, renderToCanvas, restoreSessionDeck, savedPresentationFileName, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius };
|
|
12903
|
-
export type { AutosaveRecord, AutosaveStatus, CanvasSize, CollaborationConfig, CollaborationRole, CollaborationTransport, ElementUpdate, ElementUpdateOptions, ExportGifOptions, ExportPdfOptions, ExportVideoOptions, ExternalCollaborationAwareness, ExternalCollaborationSession, ExternalCollaborationSnapshot, PowerPointViewerApi, PowerPointViewerProps, PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiUIMessage, PptxAiWritePolicy, PrintOptions, SavedPresentationFormat, SessionDeck, SvgExportAllOptions, SvgExportSingleSlideOptions, TranslationDictionary, Translator, ViewerLoadDetail, ViewerTheme, ViewerThemeColors, ViewportFitOptions, ViewportFitPadding };
|
|
12952
|
+
export { PPTX_OPEN_ACCEPT, PRESENTATION_OPEN_EXTENSIONS, PowerPointViewer, createImageElementFromFile, defaultCssVars, defaultRadius, defaultThemeColors, deleteAutosaveSnapshot, describeCollaborationShellState, exportAllSlidesToSvg, exportAllSlidesToSvgBlobs, exportSlideAsSvg, exportSlideToSvg, exportSlideToSvgBlob, forgetSessionDeck, getAutosaveSnapshot, getSessionTabId, isLegacyBinaryPresentation, isSupportedPresentationFile, listAutosaveSnapshots, loadPresentationDeck, loadSessionDeck, parsePresentationSessionId, presentationBaseName, registerTranslations, rememberSessionDeck, renderToCanvas, restoreSessionDeck, savedPresentationFileName, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius };
|
|
12953
|
+
export type { AutosaveRecord, AutosaveStatus, CanvasSize, CollaborationConfig, CollaborationRole, CollaborationShellState, CollaborationTransport, ConnectionStatus, ElementUpdate, ElementUpdateOptions, ExportGifOptions, ExportPdfOptions, ExportVideoOptions, ExternalCollaborationAwareness, ExternalCollaborationSession, ExternalCollaborationSnapshot, PowerPointViewerApi, PowerPointViewerProps, PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiUIMessage, PptxAiWritePolicy, PrintOptions, RemoteCursor, SanitizedPresence, SavedPresentationFormat, SessionDeck, SvgExportAllOptions, SvgExportSingleSlideOptions, TranslationDictionary, Translator, ViewerLoadDetail, ViewerTheme, ViewerThemeColors, ViewportFitOptions, ViewportFitPadding };
|
package/dist/index.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as I } from "./translator-
|
|
3
|
-
import { a as _, c as
|
|
1
|
+
import { Bu as e, Ch as a, Cl as o, Dl as r, Il as i, Kd as t, Km as l, Ll as n, Nc as S, Nl as m, Sh as d, _p as p, bh as T, ds as h, ec as v, fc as g, fn as P, is as c, os as u, rd as C, rs as N, sn as f, ss as A, up as D, xh as E, yh as b, zo as k } from "./transition-overlay-Dvef1UAZ.js";
|
|
2
|
+
import { i as I } from "./translator-D7duxy6A.js";
|
|
3
|
+
import { a as _, c as F, l as L, o as O, s as y, t as R, u as V } from "./export-gq-uU4it.js";
|
|
4
4
|
import "./i18n.js";
|
|
5
5
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
f as PPTX_OPEN_ACCEPT,
|
|
7
|
+
P as PRESENTATION_OPEN_EXTENSIONS,
|
|
8
|
+
R as PowerPointViewer,
|
|
9
|
+
k as createImageElementFromFile,
|
|
10
|
+
N as defaultCssVars,
|
|
11
|
+
c as defaultRadius,
|
|
12
|
+
u as defaultThemeColors,
|
|
13
|
+
A as deleteAutosaveSnapshot,
|
|
14
|
+
h as describeCollaborationShellState,
|
|
14
15
|
O as exportAllSlidesToSvg,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
y as exportAllSlidesToSvgBlobs,
|
|
17
|
+
F as exportSlideAsSvg,
|
|
18
|
+
L as exportSlideToSvg,
|
|
19
|
+
V as exportSlideToSvgBlob,
|
|
20
|
+
v as forgetSessionDeck,
|
|
21
|
+
g as getAutosaveSnapshot,
|
|
22
|
+
S as getSessionTabId,
|
|
23
|
+
o as isLegacyBinaryPresentation,
|
|
24
|
+
r as isSupportedPresentationFile,
|
|
25
|
+
m as listAutosaveSnapshots,
|
|
26
|
+
i as loadPresentationDeck,
|
|
27
|
+
n as loadSessionDeck,
|
|
28
|
+
e as parsePresentationSessionId,
|
|
29
|
+
C as presentationBaseName,
|
|
29
30
|
I as registerTranslations,
|
|
30
|
-
|
|
31
|
+
t as rememberSessionDeck,
|
|
31
32
|
_ as renderToCanvas,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
D as restoreSessionDeck,
|
|
34
|
+
p as savedPresentationFileName,
|
|
35
|
+
l as themeToCssVars,
|
|
36
|
+
b as vermilionDarkColors,
|
|
37
|
+
T as vermilionDarkTheme,
|
|
38
|
+
E as vermilionLightColors,
|
|
38
39
|
d as vermilionLightTheme,
|
|
39
|
-
|
|
40
|
+
a as vermilionRadius
|
|
40
41
|
};
|
package/dist/internals.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Af as a, Bn as n, Ec as i, Fc as T, Ut as t, Vn as S, Wf as e, Yf as A, cr as E, ft as _, gr as o, hc as I, ht as r, in as N, kf as R, nn as O, np as M, op as D, rn as l, t as F, tt as L, wn as P, xt as Y } from "./transition-overlay-Dvef1UAZ.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
L as CINEMATIC_TRANSITION_KEYFRAMES,
|
|
4
|
+
_ as DEFAULT_MORPH_DURATION_MS,
|
|
5
5
|
r as DEFAULT_TRANSITION_DURATION_MS,
|
|
6
|
-
|
|
6
|
+
Y as EASE,
|
|
7
7
|
t as INSTANT,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
O as P14_TRANSITION_KEYFRAMES,
|
|
9
|
+
l as P14_TRANSITION_KEYFRAMES_2,
|
|
10
10
|
N as P14_TRANSITION_KEYFRAMES_ALL,
|
|
11
|
-
|
|
11
|
+
F as PresentationTransitionOverlay,
|
|
12
12
|
P as RANDOM_ELIGIBLE_TYPES,
|
|
13
|
-
|
|
13
|
+
n as SLIDE_TRANSITION_KEYFRAMES,
|
|
14
14
|
S as SLIDE_TRANSITION_KEYFRAMES_CSS,
|
|
15
|
-
|
|
15
|
+
E as TRANSITION_SPEED_DURATION_MS,
|
|
16
16
|
o as WHEEL_SPOKE_COUNTS,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
I as getCinematicTransitionAnimations,
|
|
18
|
+
i as getP14TransitionAnimations,
|
|
19
19
|
T as getSlideTransitionAnimations,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
R as resolveDirection,
|
|
21
|
+
a as resolveDirection8,
|
|
22
|
+
e as resolveOrientation,
|
|
23
|
+
A as resolveSlideTransition,
|
|
24
|
+
M as resolveTransitionDurationMs,
|
|
25
25
|
D as resolveWheelSpokeCount
|
|
26
26
|
};
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { AmbientLight as U, BufferGeometry as V, CanvasTexture as Z, Color as E, DirectionalLight as C, EdgesGeometry as X, Euler as _, ExtrudeGeometry as j, Group as q, Line as J, LineBasicMaterial as B, LineSegments as K, LinearFilter as A, Mesh as Y, MeshBasicMaterial as Q, MeshStandardMaterial as tt, PerspectiveCamera as et, PlaneGeometry as nt, RepeatWrapping as ot, SRGBColorSpace as it, Scene as at, Shape as st, Vector3 as $, WebGLRenderer as rt } from "./three.module-BP1MPwgf.js";
|
|
2
|
+
import { OrbitControls as lt } from "./OrbitControls-Dj3MmTu8.js";
|
|
3
|
+
var F = 4, H = 0.86;
|
|
4
|
+
function ct(e, t, n) {
|
|
5
|
+
const o = t.split(/\s+/u).filter(Boolean);
|
|
6
|
+
if (o.length === 0) return [];
|
|
7
|
+
const s = [];
|
|
8
|
+
let i = o[0];
|
|
9
|
+
for (let a = 1; a < o.length; a++) {
|
|
10
|
+
const r = `${i} ${o[a]}`;
|
|
11
|
+
e.measureText(r).width <= n ? i = r : (s.push(i), i = o[a]);
|
|
12
|
+
}
|
|
13
|
+
return s.push(i), s;
|
|
14
|
+
}
|
|
15
|
+
function ft(e, t) {
|
|
16
|
+
const n = t?.bold === void 0 ? "600" : t.bold ? "700" : "400", o = t?.italic ? "italic " : "", s = typeof t?.fontScale == "number" && Number.isFinite(t.fontScale) && t.fontScale > 0 ? t.fontScale : 1;
|
|
17
|
+
return {
|
|
18
|
+
weight: n,
|
|
19
|
+
italic: o,
|
|
20
|
+
color: t?.color ?? e,
|
|
21
|
+
scale: s
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function dt(e, t, n, o, s, i) {
|
|
25
|
+
if (typeof document > "u" || !e.trim() || o <= 0 || s <= 0) return null;
|
|
26
|
+
const { weight: a, italic: r, color: c, scale: h } = ft(t, i), v = o * H, w = s * H, f = document.createElement("canvas");
|
|
27
|
+
f.width = Math.max(8, Math.round(v * F)), f.height = Math.max(8, Math.round(w * F));
|
|
28
|
+
const l = f.getContext("2d");
|
|
29
|
+
if (!l) return null;
|
|
30
|
+
const M = "system-ui, -apple-system, Segoe UI, Roboto, sans-serif", g = f.width * 0.94, m = (y) => `${r}${a} ${y}px ${M}`;
|
|
31
|
+
let p = Math.max(6, n) * h * F, b = [];
|
|
32
|
+
for (let y = 0; y < 12; y++) {
|
|
33
|
+
l.font = m(p), b = ct(l, e, g);
|
|
34
|
+
const x = p * 1.2;
|
|
35
|
+
if (b.length * x <= f.height * 0.96 || p <= 6 * F) break;
|
|
36
|
+
p *= 0.88;
|
|
37
|
+
}
|
|
38
|
+
l.clearRect(0, 0, f.width, f.height), l.fillStyle = c, l.textAlign = "center", l.textBaseline = "middle", l.font = m(p);
|
|
39
|
+
const d = p * 1.2, L = b.length * d, S = f.height / 2 - L / 2 + d / 2;
|
|
40
|
+
for (let y = 0; y < b.length; y++) {
|
|
41
|
+
const x = S + y * d;
|
|
42
|
+
if (l.fillText(b[y], f.width / 2, x), i?.underline) {
|
|
43
|
+
const z = l.measureText(b[y]).width;
|
|
44
|
+
l.strokeStyle = c, l.lineWidth = Math.max(1, p * 0.06), l.beginPath(), l.moveTo(f.width / 2 - z / 2, x + p * 0.32), l.lineTo(f.width / 2 + z / 2, x + p * 0.32), l.stroke();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const u = new Z(f);
|
|
48
|
+
return u.colorSpace = it, u.minFilter = A, u.magFilter = A, u.flipY = !1, u.premultiplyAlpha = !1, u.wrapT = ot, u.repeat.set(1, -1), u.offset.set(0, 1), u.needsUpdate = !0, {
|
|
49
|
+
texture: u,
|
|
50
|
+
worldWidth: v,
|
|
51
|
+
worldHeight: w
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function ht(e) {
|
|
55
|
+
const t = new st();
|
|
56
|
+
e.outline.forEach((o, s) => {
|
|
57
|
+
s === 0 ? t.moveTo(o.x, o.y) : t.lineTo(o.x, o.y);
|
|
58
|
+
}), t.closePath();
|
|
59
|
+
const n = e.bevel > 0;
|
|
60
|
+
return new j(t, {
|
|
61
|
+
depth: e.depth,
|
|
62
|
+
bevelEnabled: n,
|
|
63
|
+
bevelThickness: e.bevel,
|
|
64
|
+
bevelSize: e.bevel,
|
|
65
|
+
bevelSegments: 2,
|
|
66
|
+
curveSegments: e.rounded ? 24 : 1,
|
|
67
|
+
steps: 1
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function pt(e, t, n) {
|
|
71
|
+
const o = ht(n), s = new tt({
|
|
72
|
+
color: new E(n.fill),
|
|
73
|
+
metalness: 0.12,
|
|
74
|
+
roughness: 0.52,
|
|
75
|
+
transparent: n.opacity < 1,
|
|
76
|
+
opacity: n.opacity
|
|
77
|
+
}), i = new Y(o, s);
|
|
78
|
+
if (i.position.set(n.position.x, n.position.y, n.position.z), i.rotation.set(n.rotation.x, n.rotation.y, n.rotation.z), e.add(i), t.push(o, s), n.strokeWidth > 0) {
|
|
79
|
+
const a = new X(o, 30), r = new B({ color: new E(n.stroke) }), c = new K(a, r);
|
|
80
|
+
c.position.copy(i.position), c.rotation.copy(i.rotation), e.add(c), t.push(a, r);
|
|
81
|
+
}
|
|
82
|
+
return o;
|
|
83
|
+
}
|
|
84
|
+
function W(e, t) {
|
|
85
|
+
if (!e.text) return null;
|
|
86
|
+
const n = dt(e.text, e.textColor, e.fontSize, e.halfWidth * 2, e.halfHeight * 2, t);
|
|
87
|
+
if (!n) return null;
|
|
88
|
+
const o = new nt(n.worldWidth, n.worldHeight), s = new Q({
|
|
89
|
+
map: n.texture,
|
|
90
|
+
transparent: !0,
|
|
91
|
+
depthWrite: !1,
|
|
92
|
+
depthTest: !1,
|
|
93
|
+
side: 2
|
|
94
|
+
}), i = new Y(o, s);
|
|
95
|
+
i.renderOrder = 1;
|
|
96
|
+
const a = new _(e.rotation.x, e.rotation.y, e.rotation.z), r = new $(0, 0, e.depth + e.bevel + 0.4).applyEuler(a);
|
|
97
|
+
return i.position.set(e.position.x + r.x, e.position.y + r.y, e.position.z + r.z), i.rotation.copy(a), {
|
|
98
|
+
plane: i,
|
|
99
|
+
disposables: [
|
|
100
|
+
o,
|
|
101
|
+
s,
|
|
102
|
+
n.texture
|
|
103
|
+
]
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function ut(e, t, n) {
|
|
107
|
+
for (const o of n.connectors) {
|
|
108
|
+
if (o.points.length < 2) continue;
|
|
109
|
+
const s = new V().setFromPoints(o.points.map((a) => new $(a.x, a.y, a.z))), i = new B({
|
|
110
|
+
color: new E(o.color),
|
|
111
|
+
transparent: !0,
|
|
112
|
+
opacity: 0.7
|
|
113
|
+
});
|
|
114
|
+
e.add(new J(s, i)), t.push(s, i);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function D(e, t) {
|
|
118
|
+
t.plane && e.remove(t.plane);
|
|
119
|
+
for (const n of t.disposables) n.dispose();
|
|
120
|
+
t.plane = null, t.disposables = [];
|
|
121
|
+
}
|
|
122
|
+
function xt(e, t) {
|
|
123
|
+
const n = new q(), o = [], s = e.meshes.map((i) => {
|
|
124
|
+
pt(n, o, i);
|
|
125
|
+
const a = W(i, t);
|
|
126
|
+
return a && n.add(a.plane), {
|
|
127
|
+
node: i,
|
|
128
|
+
plane: a?.plane ?? null,
|
|
129
|
+
disposables: a?.disposables ?? []
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
return ut(n, o, e), {
|
|
133
|
+
group: n,
|
|
134
|
+
setTextStyle(i) {
|
|
135
|
+
for (const a of s) {
|
|
136
|
+
D(n, a);
|
|
137
|
+
const r = W(a.node, i);
|
|
138
|
+
r && (n.add(r.plane), a.plane = r.plane, a.disposables = r.disposables);
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
forEachLabelPlane(i) {
|
|
142
|
+
for (const a of s) a.plane && i(a.plane);
|
|
143
|
+
},
|
|
144
|
+
dispose() {
|
|
145
|
+
for (const i of o) i.dispose();
|
|
146
|
+
for (const i of s) D(n, i);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
var I = 42;
|
|
151
|
+
function yt(e, t) {
|
|
152
|
+
const n = t.halfWidth + t.bevel, o = t.halfHeight + t.bevel, s = t.depth / 2 + t.bevel, i = t.position.z + t.depth / 2, a = Math.cos(t.rotation.y), r = Math.sin(t.rotation.y), c = Math.abs(n * a) + Math.abs(s * r), h = Math.abs(n * r) + Math.abs(s * a);
|
|
153
|
+
e(t.position.x, t.position.y, i, c, o, h);
|
|
154
|
+
}
|
|
155
|
+
function bt(e) {
|
|
156
|
+
let t = 1 / 0, n = 1 / 0, o = 1 / 0, s = -1 / 0, i = -1 / 0, a = -1 / 0;
|
|
157
|
+
const r = (c, h, v, w, f, l) => {
|
|
158
|
+
t = Math.min(t, c - w), n = Math.min(n, h - f), o = Math.min(o, v - l), s = Math.max(s, c + w), i = Math.max(i, h + f), a = Math.max(a, v + l);
|
|
159
|
+
};
|
|
160
|
+
for (const c of e.meshes) yt(r, c);
|
|
161
|
+
for (const c of e.connectors) for (const h of c.points) r(h.x, h.y, h.z, 1, 1, 1);
|
|
162
|
+
if (!Number.isFinite(t)) {
|
|
163
|
+
const c = e.bounds.width / 2 || 1, h = e.bounds.height / 2 || 1;
|
|
164
|
+
return {
|
|
165
|
+
cx: 0,
|
|
166
|
+
cy: 0,
|
|
167
|
+
cz: 0,
|
|
168
|
+
radius: Math.max(c, h),
|
|
169
|
+
halfW: c,
|
|
170
|
+
halfH: h,
|
|
171
|
+
halfD: 1
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
cx: (t + s) / 2,
|
|
176
|
+
cy: (n + i) / 2,
|
|
177
|
+
cz: (o + a) / 2,
|
|
178
|
+
radius: 0.5 * Math.hypot(s - t, i - n, a - o) || 1,
|
|
179
|
+
halfW: (s - t) / 2,
|
|
180
|
+
halfH: (i - n) / 2,
|
|
181
|
+
halfD: (a - o) / 2
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function wt(e, t) {
|
|
185
|
+
const n = I * Math.PI / 180, o = 2 * Math.atan(Math.tan(n / 2) * t);
|
|
186
|
+
return e / Math.sin(Math.min(n, o) / 2) * 1.1;
|
|
187
|
+
}
|
|
188
|
+
var Mt = 0.92;
|
|
189
|
+
function G(e, t, n) {
|
|
190
|
+
const { cx: o, cy: s, cz: i, radius: a } = e, r = St(t, a, n);
|
|
191
|
+
return {
|
|
192
|
+
position: [
|
|
193
|
+
o + a * 0.25,
|
|
194
|
+
s + r,
|
|
195
|
+
i + n
|
|
196
|
+
],
|
|
197
|
+
target: [
|
|
198
|
+
o,
|
|
199
|
+
s,
|
|
200
|
+
i
|
|
201
|
+
],
|
|
202
|
+
dist: n
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function gt(e, t, n) {
|
|
206
|
+
const o = I * Math.PI / 180, s = Math.tan(o / 2), i = s * n, [a, r, c] = t.position, [h, v, w] = t.target;
|
|
207
|
+
let f = h - a, l = v - r, M = w - c;
|
|
208
|
+
const g = Math.hypot(f, l, M) || 1;
|
|
209
|
+
f /= g, l /= g, M /= g;
|
|
210
|
+
let m = -M, p = f;
|
|
211
|
+
const b = Math.hypot(m, p) || 1;
|
|
212
|
+
m /= b, p /= b;
|
|
213
|
+
const d = -p * l, L = p * f - m * M, S = m * l;
|
|
214
|
+
let u = 0;
|
|
215
|
+
for (const y of [-1, 1]) for (const x of [-1, 1]) for (const z of [-1, 1]) {
|
|
216
|
+
const P = e.cx + y * e.halfW - a, R = e.cy + x * e.halfH - r, T = e.cz + z * e.halfD - c, k = P * f + R * l + T * M;
|
|
217
|
+
if (k <= 1e-6) return 1 / 0;
|
|
218
|
+
const O = Math.abs(P * m + T * p) / (k * i), N = Math.abs(P * d + R * L + T * S) / (k * s);
|
|
219
|
+
u = Math.max(u, O, N);
|
|
220
|
+
}
|
|
221
|
+
return u;
|
|
222
|
+
}
|
|
223
|
+
function vt(e, t, n) {
|
|
224
|
+
let o = wt(e.radius, n), s = G(e, t, o);
|
|
225
|
+
for (let i = 0; i < 8; i++) {
|
|
226
|
+
const a = gt(e, s, n);
|
|
227
|
+
if (!Number.isFinite(a)) o *= 2;
|
|
228
|
+
else {
|
|
229
|
+
const r = a / Mt;
|
|
230
|
+
if (Math.abs(r - 1) < 0.01) break;
|
|
231
|
+
o *= r;
|
|
232
|
+
}
|
|
233
|
+
s = G(e, t, o);
|
|
234
|
+
}
|
|
235
|
+
return s;
|
|
236
|
+
}
|
|
237
|
+
var mt = 34;
|
|
238
|
+
function St(e, t, n) {
|
|
239
|
+
return e === "cycle" || e === "radial" ? n * Math.tan(mt * Math.PI / 180) : t * 0.3;
|
|
240
|
+
}
|
|
241
|
+
function zt(e, t) {
|
|
242
|
+
e.forEachLabelPlane((n) => {
|
|
243
|
+
const o = t.position.x - n.position.x, s = t.position.z - n.position.z;
|
|
244
|
+
n.rotation.set(0, Math.atan2(o, s), 0);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function Pt(e, t, n, o, s = {}) {
|
|
248
|
+
const i = new rt({
|
|
249
|
+
canvas: e,
|
|
250
|
+
antialias: !0,
|
|
251
|
+
alpha: !s.background
|
|
252
|
+
});
|
|
253
|
+
i.setPixelRatio(Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, s.maxPixelRatio ?? 2)), i.setSize(n, o, !1);
|
|
254
|
+
const a = new at();
|
|
255
|
+
s.background && (a.background = new E(s.background));
|
|
256
|
+
const r = bt(t), { cx: c, cy: h, cz: v, radius: w } = r, f = n / Math.max(1, o), l = vt(r, t.family, f), { dist: M } = l, g = new et(I, f, 0.1, M * 8 + w * 4);
|
|
257
|
+
g.position.set(...l.position), g.lookAt(...l.target), a.add(new U(16777215, 0.62));
|
|
258
|
+
const m = new C(16777215, 0.95);
|
|
259
|
+
m.position.set(c + w, h + w * 1.4, v + M), a.add(m);
|
|
260
|
+
const p = new C(16777215, 0.3);
|
|
261
|
+
p.position.set(c - w, h - w * 0.6, v + M * 0.6), a.add(p);
|
|
262
|
+
const b = xt(t, s.textStyle);
|
|
263
|
+
a.add(b.group);
|
|
264
|
+
let d = null;
|
|
265
|
+
const L = (x) => {
|
|
266
|
+
x && !d ? (d = new lt(g, e), d.enablePan = !1, d.target.set(c, h, v), d.minDistance = M * 0.4, d.maxDistance = M * 3, d.update()) : !x && d && (d.dispose(), d = null), d && (d.autoRotate = !!s.autoRotate, d.autoRotateSpeed = 1.2);
|
|
267
|
+
};
|
|
268
|
+
L(!!s.interactive);
|
|
269
|
+
let S = 0, u = !1;
|
|
270
|
+
const y = () => {
|
|
271
|
+
u || (S = requestAnimationFrame(y), zt(b, g), d?.update(), i.render(a, g));
|
|
272
|
+
};
|
|
273
|
+
return S = requestAnimationFrame(y), {
|
|
274
|
+
resize(x, z) {
|
|
275
|
+
g.aspect = x / Math.max(1, z), g.updateProjectionMatrix(), i.setSize(x, z, !1);
|
|
276
|
+
},
|
|
277
|
+
setInteractive(x) {
|
|
278
|
+
L(x);
|
|
279
|
+
},
|
|
280
|
+
setTextStyle(x) {
|
|
281
|
+
b.setTextStyle(x);
|
|
282
|
+
},
|
|
283
|
+
dispose() {
|
|
284
|
+
u = !0, cancelAnimationFrame(S), d?.dispose(), b.dispose(), i.dispose();
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
export {
|
|
289
|
+
Pt as mountSmartArt3D
|
|
290
|
+
};
|