@printine/pod-editor 0.1.14 → 0.1.15
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/README.md +27 -45
- package/dist/api/asset-client.d.ts +1 -1
- package/dist/components/context.d.ts +2 -2
- package/dist/components/design.d.ts +2 -2
- package/dist/components/preview/index.d.ts +2 -2
- package/dist/components/upload-types.d.ts +20 -0
- package/dist/{design-C_TmcalT.js → design-CZvEVkwi.js} +5588 -5594
- package/dist/full-designer.js +2 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +134 -146
- package/dist/lib/base-plate.d.ts +3 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -29
- package/docs/HOST_DATA_CONTRACT.md +77 -69
- package/docs/INTEGRATION_API.md +25 -27
- package/package.json +2 -11
- package/dist/api/client.d.ts +0 -8
- package/dist/api/client.js +0 -82
- package/dist/api/common-endpoints.d.ts +0 -12
- package/dist/api/design-endpoints.d.ts +0 -4
- package/dist/api/endpoints.d.ts +0 -23
- package/dist/api/endpoints.js +0 -33
- package/dist/api/files-endpoints.d.ts +0 -1
- package/dist/components/menus/ai.d.ts +0 -5
- package/dist/hooks/use-oss-upload.d.ts +0 -36
package/dist/full-designer.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "./
|
|
4
|
-
import { b as s } from "./design-C_TmcalT.js";
|
|
3
|
+
import { c as l } from "./design-CZvEVkwi.js";
|
|
5
4
|
import "./engine/events.js";
|
|
6
5
|
import "zustand/react/shallow";
|
|
7
6
|
import "./engine/history.js";
|
|
@@ -10,5 +9,5 @@ import "./engine/constants.js";
|
|
|
10
9
|
import "./engine/utils/common.js";
|
|
11
10
|
import "./designer-store-Da9fICz8.js";
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
l as default
|
|
14
13
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,10 +16,8 @@ export type { FontListProps } from './components/fonts';
|
|
|
16
16
|
export { SimpleSelect } from './ui/simple-select';
|
|
17
17
|
export { CanvasDesigner, renderPlacementPreviews } from './engine/canvas-designer';
|
|
18
18
|
export { Editor } from './engine/editor';
|
|
19
|
-
export { createDesignerApiClient } from './api/client';
|
|
20
19
|
export { createAssetCenterApiClient, DEFAULT_PRINTINE_ASSET_BASE_URL } from './api/asset-client';
|
|
21
20
|
export { AssetCenterApi, setAssetCenterApiClient } from './api/asset-endpoints';
|
|
22
|
-
export { CommonApi, DesignApi, setDesignerApiClient } from './api/endpoints';
|
|
23
21
|
export { HistoryManager } from './engine/history';
|
|
24
22
|
export { ALIGN_TYPES, DEFAULT_FILL_COLOR_LIST, DEFAULT_FONT_SIZE, ELEMENT_TITLE_MAP, FONT_WEIGHT, LAYER_BLACK_LIST, } from './engine/constants';
|
|
25
23
|
export { createEventBus, designerEventBus } from './engine/events';
|
|
@@ -37,7 +35,7 @@ export * from './engine/utils/font';
|
|
|
37
35
|
export { DEFAULT_DPI, inchToPixel, isSvg } from './engine/utils/measure';
|
|
38
36
|
export { Loading } from './engine/utils/loading';
|
|
39
37
|
export { getImageControls, setDefaultControls } from './engine/utils/setting';
|
|
40
|
-
export type {
|
|
38
|
+
export type { AssetCenterApiClient, AssetCenterApiClientOptions, AssetCenterApiResponse, AssetCenterPagination, DesignerAdapters, DesignerAsset, DesignerAssetsAdapter, DesignerError, DesignerEvent, DesignerImageUploadInput, DesignerImageUploadPurpose, DesignerImageUploadResult, DesignerImageMetadata, DesignerLibraryAdapters, DesignerShape, DesignerClipart, DesignerClipartCategory, DesignerPage, DesignerProductInfo, DesignerRenderPreviewInput, DesignerSaveInput, DesignerTemplatesAdapter, DesignerUserTemplate, DesignerRuntime, DesignDocument, PrintineDesignerProps, } from './types';
|
|
41
39
|
export type { AppEvents, DesignerEventBus } from './engine/events';
|
|
42
40
|
export type { EditorOptions } from './engine/editor';
|
|
43
41
|
export type { DesignerState } from './state/designer-store';
|
package/dist/index.js
CHANGED
|
@@ -1,99 +1,91 @@
|
|
|
1
|
-
import { AdvancedIText as
|
|
2
|
-
import { s as
|
|
3
|
-
import { F as
|
|
4
|
-
import { jsx as r, jsxs as
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import { fabric as Pr } from "fabric";
|
|
34
|
-
function X(e) {
|
|
1
|
+
import { AdvancedIText as G } from "./engine/fabric.js";
|
|
2
|
+
import { a as S, s as f, D as L, b as _, c as C, C as F } from "./design-CZvEVkwi.js";
|
|
3
|
+
import { F as K, S as V, u as X } from "./design-CZvEVkwi.js";
|
|
4
|
+
import { jsx as r, jsxs as R } from "react/jsx-runtime";
|
|
5
|
+
import { useMemo as b, useEffect as a } from "react";
|
|
6
|
+
import { DEFAULT_PRINTINE_ASSET_BASE_URL as U, createAssetCenterApiClient as B } from "./api/asset-client.js";
|
|
7
|
+
import { s as d } from "./designer-store-Da9fICz8.js";
|
|
8
|
+
import { A as $, u as q } from "./designer-store-Da9fICz8.js";
|
|
9
|
+
import { d as y, s as M } from "./config-D2qm60gf.js";
|
|
10
|
+
import { P as Q, a as ee } from "./semi-interact-editor-DfzphWy3.js";
|
|
11
|
+
import { P as te } from "./pixel-map-dSys7UAx.js";
|
|
12
|
+
import { CanvasDesigner as ae, renderPlacementPreviews as ne } from "./engine/canvas-designer.js";
|
|
13
|
+
import { Editor as ie } from "./engine/editor.js";
|
|
14
|
+
import { HistoryManager as me } from "./engine/history.js";
|
|
15
|
+
import { ALIGN_TYPES as de, DEFAULT_FILL_COLOR_LIST as ge, DEFAULT_FONT_SIZE as pe, ELEMENT_TITLE_MAP as ce, FONT_WEIGHT as ue, LAYER_BLACK_LIST as xe } from "./engine/constants.js";
|
|
16
|
+
import { createEventBus as Te, default as ve } from "./engine/events.js";
|
|
17
|
+
import { SnaplineManager as Ie } from "./engine/managers/snapline.js";
|
|
18
|
+
import { ResizeManager as Ae } from "./engine/managers/resize.js";
|
|
19
|
+
import { WorkspaceManager as Le } from "./engine/managers/workspace.js";
|
|
20
|
+
import { EventManager as Ce } from "./engine/managers/event.js";
|
|
21
|
+
import { ImageProcessor as Re } from "./engine/processors/image.js";
|
|
22
|
+
import { TextProcessor as Ue } from "./engine/processors/text.js";
|
|
23
|
+
import { TemplateProcessor as ye } from "./engine/processors/template.js";
|
|
24
|
+
import { blobToDataURL as Ne, blobUrlToFile as he, cloneObject as Oe, dataUrlToFile as ze, directionOffsetToXY as He, generateThumbImage as je, getCanvasSize as we, resizeBase64Image as ke, toHorizontalRaw as Ye, toVerticalStack as Ge, urlToBlob as We, urlToDataURL as Ke, xyToDirectionOffset as Ve } from "./engine/utils/common.js";
|
|
25
|
+
import { loadImage as Ze, loadOverlaySvgImage as $e, loadSvgImage as qe } from "./engine/utils/image.js";
|
|
26
|
+
import { fontCache as Qe, loadFontFile as er, loadFontface as rr } from "./engine/utils/font.js";
|
|
27
|
+
import { DEFAULT_DPI as or, inchToPixel as ar, isSvg as nr } from "./engine/utils/measure.js";
|
|
28
|
+
import { Loading as ir } from "./engine/utils/loading.js";
|
|
29
|
+
import { getImageControls as mr, setDefaultControls as fr } from "./engine/utils/setting.js";
|
|
30
|
+
import { fabric as gr } from "fabric";
|
|
31
|
+
function w(e) {
|
|
32
|
+
S(e.basePlate);
|
|
35
33
|
const {
|
|
36
|
-
productId:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
onClose: F,
|
|
56
|
-
onEvent: p,
|
|
57
|
-
onAnalytics: f
|
|
58
|
-
} = e, s = c(() => M({ apiBaseUrl: i, locale: n }), [i, n]), g = c(() => O({ assetBaseUrl: l }), [l]);
|
|
34
|
+
productId: t,
|
|
35
|
+
assetBaseUrl: n = U,
|
|
36
|
+
locale: g,
|
|
37
|
+
imageBaseUrl: s,
|
|
38
|
+
threeDEnvironmentUrl: p,
|
|
39
|
+
basePlate: c,
|
|
40
|
+
loading: u = !1,
|
|
41
|
+
initialDesignData: x,
|
|
42
|
+
initialBackgroundCustomized: E,
|
|
43
|
+
productInfo: T,
|
|
44
|
+
adapters: o,
|
|
45
|
+
semiDesignPermission: v,
|
|
46
|
+
messages: D,
|
|
47
|
+
className: I,
|
|
48
|
+
children: P,
|
|
49
|
+
onClose: A,
|
|
50
|
+
onEvent: i,
|
|
51
|
+
onAnalytics: l
|
|
52
|
+
} = e, m = b(() => B({ assetBaseUrl: n }), [n]);
|
|
59
53
|
return a(() => {
|
|
60
|
-
|
|
61
|
-
}, [
|
|
62
|
-
...
|
|
54
|
+
i?.({ name: "ready", productId: t });
|
|
55
|
+
}, [i, t]), a(() => (d(m), () => d(null)), [m]), a(() => (f(l ?? null), () => f(null)), [l]), M({
|
|
56
|
+
...s !== void 0 ? { imageBaseUrl: s } : {}
|
|
63
57
|
}), /* @__PURE__ */ r(
|
|
64
|
-
|
|
58
|
+
L,
|
|
65
59
|
{
|
|
66
60
|
value: {
|
|
67
|
-
productId:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
onClose: F,
|
|
61
|
+
productId: t,
|
|
62
|
+
initialDesignData: x,
|
|
63
|
+
initialBackgroundCustomized: E,
|
|
64
|
+
productInfo: T,
|
|
65
|
+
uploadImage: o?.uploadImage,
|
|
66
|
+
assets: o?.assets,
|
|
67
|
+
templates: o?.templates,
|
|
68
|
+
library: o?.library,
|
|
69
|
+
locale: g,
|
|
70
|
+
threeDEnvironmentUrl: p,
|
|
71
|
+
messages: D,
|
|
72
|
+
onClose: A,
|
|
80
73
|
onSave: e.onSave,
|
|
81
74
|
onRenderPreview: e.onRenderPreview,
|
|
82
75
|
onError: e.onError,
|
|
83
|
-
onEvent: e.onEvent
|
|
84
|
-
api: s
|
|
76
|
+
onEvent: e.onEvent
|
|
85
77
|
},
|
|
86
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ R(
|
|
87
79
|
"section",
|
|
88
80
|
{
|
|
89
|
-
className: ["printine-designer",
|
|
90
|
-
"data-product-id":
|
|
81
|
+
className: ["printine-designer", I].filter(Boolean).join(" "),
|
|
82
|
+
"data-product-id": t,
|
|
91
83
|
style: {
|
|
92
|
-
"--printine-designer-transparent-pattern": `url("${
|
|
84
|
+
"--printine-designer-transparent-pattern": `url("${y("/images/design/transparent_pattern.svg")}")`
|
|
93
85
|
},
|
|
94
86
|
children: [
|
|
95
|
-
/* @__PURE__ */ r("main", { className: "printine-designer__content", children:
|
|
96
|
-
/* @__PURE__ */ r(
|
|
87
|
+
/* @__PURE__ */ r("main", { className: "printine-designer__content", children: P ?? (u ? /* @__PURE__ */ r(_, {}) : /* @__PURE__ */ r(C, { basePlate: c, semiDesignPermission: v })) }),
|
|
88
|
+
/* @__PURE__ */ r(F, {})
|
|
97
89
|
]
|
|
98
90
|
}
|
|
99
91
|
)
|
|
@@ -101,68 +93,64 @@ function X(e) {
|
|
|
101
93
|
);
|
|
102
94
|
}
|
|
103
95
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
mr as
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
or as urlToDataURL,
|
|
165
|
-
re as useDesignerRuntime,
|
|
166
|
-
ie as useDesignerStore,
|
|
167
|
-
tr as xyToDirectionOffset
|
|
96
|
+
de as ALIGN_TYPES,
|
|
97
|
+
G as AdvancedIText,
|
|
98
|
+
$ as AssetCenterApi,
|
|
99
|
+
ae as CanvasDesigner,
|
|
100
|
+
or as DEFAULT_DPI,
|
|
101
|
+
ge as DEFAULT_FILL_COLOR_LIST,
|
|
102
|
+
pe as DEFAULT_FONT_SIZE,
|
|
103
|
+
U as DEFAULT_PRINTINE_ASSET_BASE_URL,
|
|
104
|
+
L as DesignerRuntimeProvider,
|
|
105
|
+
ce as ELEMENT_TITLE_MAP,
|
|
106
|
+
ie as Editor,
|
|
107
|
+
Ce as EventManager,
|
|
108
|
+
ue as FONT_WEIGHT,
|
|
109
|
+
K as FontList,
|
|
110
|
+
C as FullDesigner,
|
|
111
|
+
me as HistoryManager,
|
|
112
|
+
Re as ImageProcessor,
|
|
113
|
+
xe as LAYER_BLACK_LIST,
|
|
114
|
+
ir as Loading,
|
|
115
|
+
te as PixelMapRenderer,
|
|
116
|
+
w as PrintineDesigner,
|
|
117
|
+
Q as PrintineSemiInteractEditor,
|
|
118
|
+
ee as PrintineSemiRenderer,
|
|
119
|
+
Ae as ResizeManager,
|
|
120
|
+
V as SimpleSelect,
|
|
121
|
+
Ie as SnaplineManager,
|
|
122
|
+
ye as TemplateProcessor,
|
|
123
|
+
Ue as TextProcessor,
|
|
124
|
+
Le as WorkspaceManager,
|
|
125
|
+
Ne as blobToDataURL,
|
|
126
|
+
he as blobUrlToFile,
|
|
127
|
+
Oe as cloneObject,
|
|
128
|
+
B as createAssetCenterApiClient,
|
|
129
|
+
Te as createEventBus,
|
|
130
|
+
ze as dataUrlToFile,
|
|
131
|
+
ve as designerEventBus,
|
|
132
|
+
He as directionOffsetToXY,
|
|
133
|
+
gr as fabric,
|
|
134
|
+
Qe as fontCache,
|
|
135
|
+
je as generateThumbImage,
|
|
136
|
+
we as getCanvasSize,
|
|
137
|
+
mr as getImageControls,
|
|
138
|
+
ar as inchToPixel,
|
|
139
|
+
nr as isSvg,
|
|
140
|
+
er as loadFontFile,
|
|
141
|
+
rr as loadFontface,
|
|
142
|
+
Ze as loadImage,
|
|
143
|
+
$e as loadOverlaySvgImage,
|
|
144
|
+
qe as loadSvgImage,
|
|
145
|
+
ne as renderPlacementPreviews,
|
|
146
|
+
ke as resizeBase64Image,
|
|
147
|
+
d as setAssetCenterApiClient,
|
|
148
|
+
fr as setDefaultControls,
|
|
149
|
+
Ye as toHorizontalRaw,
|
|
150
|
+
Ge as toVerticalStack,
|
|
151
|
+
We as urlToBlob,
|
|
152
|
+
Ke as urlToDataURL,
|
|
153
|
+
X as useDesignerRuntime,
|
|
154
|
+
q as useDesignerStore,
|
|
155
|
+
Ve as xyToDirectionOffset
|
|
168
156
|
};
|