@printstack/print-studio 0.1.2 → 0.1.3
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 +8 -2
- package/assets/{render.worker-DkH7TepL.js → render.worker-Dl59Xk1a.js} +11 -11
- package/components/button-group/ButtonGroup.d.ts +1 -1
- package/core/index.d.ts +1 -0
- package/core.js +10 -10
- package/designer/facade/entities.d.ts +4 -4
- package/designer/facade/use-print-studio.d.ts +1 -1
- package/designer/stores/editor-store.d.ts +2 -2
- package/designer/stores/selection-store.d.ts +1 -1
- package/designer.js +1 -1
- package/elements/index.d.ts +2 -4
- package/{registries-sg39PGF1.js → elements-YX-XUHtf.js} +2480 -3026
- package/host-oKlYakgn.js +123 -0
- package/index.d.ts +3 -1
- package/index.js +9 -8
- package/{mount-print-designer-DnHTrBE9.js → mount-print-designer-CAqO0T0k.js} +3 -3
- package/{mount-print-preview-Bcb08lJ-.js → mount-print-preview-DgDHL3E8.js} +2 -2
- package/package.json +19 -2
- package/parser/index.d.ts +1 -1
- package/parser/registry.d.ts +8 -0
- package/parser/render-runtime.d.ts +1 -1
- package/{presets-BunYODhE.js → presets-DmCp_Doe.js} +1 -1
- package/printer.d.ts +17 -0
- package/printer.js +3 -0
- package/registries-CyjYSHA7.js +1841 -0
- package/runtime/print-renderer.d.ts +3 -2
- package/runtime/registries.d.ts +1 -0
- package/runtime.js +31 -27
- package/{studio-B3B6zI06.js → studio-DHusmJyL.js} +1035 -1032
- package/studio.d.ts +1 -1
- package/style.css +1 -1
- package/vue.d.ts +1 -1
- package/vue.js +3158 -3158
- package/document-model-Cc5RoO4j.js +0 -1283
- package/host-OAp3gFDx.js +0 -123
package/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { createSandboxedPlugin } from './designer/plugins/sandbox-plugin';
|
|
|
10
10
|
export type { SandboxedPluginOptions } from './designer/plugins/sandbox-plugin';
|
|
11
11
|
export { definePlugin } from './designer/plugins/types';
|
|
12
12
|
export type { LazyPlugin, PluginDefinition, PluginDependency, PluginFunction, PluginInput, PluginManifest, PluginPermission, PluginResources, PluginStatus, } from './designer/plugins/types';
|
|
13
|
+
export { builtinElements } from './elements';
|
|
13
14
|
export { createPluginLocale } from './locales/plugin-locales';
|
|
14
15
|
export type { PluginLocale } from './locales/plugin-locales';
|
|
15
16
|
export { trans } from './locales/runtime';
|
|
@@ -18,6 +19,7 @@ export type { DocumentParser, ParserRegistry } from './parser/types';
|
|
|
18
19
|
export { createSaasClient, createSaasPlugin, createSaasTemplateProvider, SaasHttpError, } from './plugins/saas';
|
|
19
20
|
export type * from './plugins/saas';
|
|
20
21
|
export type { BrowserOutputOptions, PreviewHandle, } from './runtime/browser-output';
|
|
21
|
-
export {
|
|
22
|
+
export { createPrinter } from './runtime/print-renderer';
|
|
23
|
+
export { createDesigner } from './studio';
|
|
22
24
|
export type * from './studio-types';
|
|
23
25
|
export type { DesignStudio as PrintStudio } from './studio-types';
|
package/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { V as
|
|
4
|
-
import { t as
|
|
5
|
-
import { B as
|
|
6
|
-
import { i as
|
|
1
|
+
import { _ as e } from "./registries-CyjYSHA7.js";
|
|
2
|
+
import { Dt as t, t as n } from "./elements-YX-XUHtf.js";
|
|
3
|
+
import { V as r, t as i, z as a } from "./studio-DHusmJyL.js";
|
|
4
|
+
import { t as o } from "./types-Vh_6jhVV.js";
|
|
5
|
+
import { B as s } from "./cloneDeep-waBDTGc3.js";
|
|
6
|
+
import { i as c, n as l, r as u, t as d } from "./saas-D-q51uTz.js";
|
|
7
|
+
import { createPrinter as f } from "./runtime.js";
|
|
7
8
|
// src/designer/plugins/sandbox-plugin.ts
|
|
8
|
-
function
|
|
9
|
+
function p(e) {
|
|
9
10
|
let t = new URL(e.url, globalThis.location?.href);
|
|
10
11
|
if (t.protocol !== "https:" && t.protocol !== "http:") throw Error("Sandbox plugins require an HTTP module URL");
|
|
11
12
|
return {
|
|
@@ -81,4 +82,4 @@ function d(e) {
|
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
|
-
export { t as INITIAL_PARSER_VERSION,
|
|
85
|
+
export { t as INITIAL_PARSER_VERSION, r as PLUGIN_API_VERSION, c as SaasHttpError, n as builtinElements, i as createDesigner, e as createErrorRuntime, a as createPluginLocale, f as createPrinter, d as createSaasClient, l as createSaasPlugin, u as createSaasTemplateProvider, p as createSandboxedPlugin, o as definePlugin, s as trans };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-QGRDbDUS.js";
|
|
2
|
-
import { a as t, i as n, t as r } from "./studio-
|
|
3
|
-
import { t as i } from "./host-
|
|
4
|
-
import { t as a } from "./presets-
|
|
2
|
+
import { a as t, i as n, t as r } from "./studio-DHusmJyL.js";
|
|
3
|
+
import { t as i } from "./host-oKlYakgn.js";
|
|
4
|
+
import { t as a } from "./presets-DmCp_Doe.js";
|
|
5
5
|
// src/designer/mount-print-designer.ts
|
|
6
6
|
var o = /* @__PURE__ */ e({ attachDesigner: () => c }), s = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function c(e, o = {}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as e, t } from "./cloneDeep-waBDTGc3.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as r } from "./host-
|
|
2
|
+
import { g as n } from "./registries-CyjYSHA7.js";
|
|
3
|
+
import { t as r } from "./host-oKlYakgn.js";
|
|
4
4
|
// src/designer/mount-print-preview.ts
|
|
5
5
|
function i(i, a, o = {}) {
|
|
6
6
|
return n(async (n) => {
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"jspdf": "^4.2.1",
|
|
9
9
|
"tdesign-vue-next": "^1.20.11"
|
|
10
10
|
},
|
|
11
|
+
"description": "Print Studio —— Web 打印,从此简单。轻量级 Web 打印解决方案:可视化设计模板、绑定业务数据,即可预览、打印并导出 HTML / PDF。",
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|
|
13
14
|
"types": "./index.d.ts",
|
|
@@ -21,6 +22,10 @@
|
|
|
21
22
|
"types": "./designer.d.ts",
|
|
22
23
|
"import": "./designer.js"
|
|
23
24
|
},
|
|
25
|
+
"./printer": {
|
|
26
|
+
"types": "./printer.d.ts",
|
|
27
|
+
"import": "./printer.js"
|
|
28
|
+
},
|
|
24
29
|
"./runtime": {
|
|
25
30
|
"types": "./runtime/print-renderer.d.ts",
|
|
26
31
|
"import": "./runtime.js"
|
|
@@ -38,11 +43,23 @@
|
|
|
38
43
|
"files": [
|
|
39
44
|
"**/*"
|
|
40
45
|
],
|
|
46
|
+
"keywords": [
|
|
47
|
+
"print",
|
|
48
|
+
"printing",
|
|
49
|
+
"web-print",
|
|
50
|
+
"print-designer",
|
|
51
|
+
"report",
|
|
52
|
+
"template-designer",
|
|
53
|
+
"pdf",
|
|
54
|
+
"pdf-export"
|
|
55
|
+
],
|
|
41
56
|
"main": "./index.js",
|
|
42
57
|
"module": "./index.js",
|
|
43
58
|
"name": "@printstack/print-studio",
|
|
44
|
-
"sideEffects":
|
|
59
|
+
"sideEffects": [
|
|
60
|
+
"./style.css"
|
|
61
|
+
],
|
|
45
62
|
"type": "module",
|
|
46
63
|
"types": "./index.d.ts",
|
|
47
|
-
"version": "0.1.
|
|
64
|
+
"version": "0.1.3"
|
|
48
65
|
}
|
package/parser/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { HtmlParseOptions } from './html/html-parser';
|
|
|
3
3
|
import { PdfParseOptions } from './pdf/pdf-parser';
|
|
4
4
|
import { DocumentParser } from './types';
|
|
5
5
|
export type { DocumentParser, HtmlParseOptions, PdfParseOptions };
|
|
6
|
-
export { parserRegistry } from './registry';
|
|
6
|
+
export { createBuiltinParserRegistry, parserRegistry, } from './registry';
|
|
7
7
|
export { createRenderRuntime } from './render-runtime';
|
|
8
8
|
export type { RenderExecutionOptions, RenderRuntime } from './render-runtime';
|
|
9
9
|
export { buildSampleInput } from '../core/data-source';
|
package/parser/registry.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { ElementRegistry } from '../core/element-registry';
|
|
1
2
|
import { HtmlParser } from './html/html-parser';
|
|
2
3
|
import { PdfParser } from './pdf/pdf-parser';
|
|
3
4
|
import { ParserRegistry } from './types';
|
|
5
|
+
export declare function createBuiltinParserRegistry(elements?: ElementRegistry): {
|
|
6
|
+
elements: ElementRegistry;
|
|
7
|
+
html: HtmlParser;
|
|
8
|
+
pdf: PdfParser;
|
|
9
|
+
registry: ParserRegistry;
|
|
10
|
+
};
|
|
4
11
|
export declare const builtinHtmlParser: HtmlParser;
|
|
5
12
|
export declare const builtinPdfParser: PdfParser;
|
|
6
13
|
export declare const parserRegistry: ParserRegistry;
|
|
14
|
+
export declare const parserElementRegistry: ElementRegistry;
|
|
@@ -5,8 +5,8 @@ import { RuntimeConfig } from '../core/runtime-config';
|
|
|
5
5
|
import { PrintDocument } from '../core/types';
|
|
6
6
|
import { HtmlParseOptions } from './html/html-parser';
|
|
7
7
|
import { PdfParseOptions } from './pdf/pdf-parser';
|
|
8
|
-
import { ParserRegistry } from './types';
|
|
9
8
|
import { RenderWorkerFactory } from './worker/worker-client';
|
|
9
|
+
import { ParserRegistry } from './types';
|
|
10
10
|
export interface RenderExecutionOptions extends ResourceExecutionOptions {
|
|
11
11
|
onProgress?: (progress: RenderProgress) => void;
|
|
12
12
|
waitIfPaused?: () => Promise<void>;
|
package/printer.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { deserializeDocument } from './core/document-model';
|
|
2
|
+
export type { ElementDefinition } from './core/element-registry';
|
|
3
|
+
export type { PrintDocument } from './core/types';
|
|
4
|
+
export { builtinElements } from './elements';
|
|
5
|
+
export { createBuiltinElementRegistry } from './elements';
|
|
6
|
+
export { barcodeElement } from './elements/definitions/barcode-element';
|
|
7
|
+
export { ellipseElement } from './elements/definitions/ellipse-element';
|
|
8
|
+
export { imageElement } from './elements/definitions/image-element';
|
|
9
|
+
export { lineElement } from './elements/definitions/line-element';
|
|
10
|
+
export { qrcodeElement } from './elements/definitions/qrcode-element';
|
|
11
|
+
export { rectElement } from './elements/definitions/rect-element';
|
|
12
|
+
export { tableElement } from './elements/definitions/table-element';
|
|
13
|
+
export { textElement } from './elements/definitions/text-element';
|
|
14
|
+
export type { HtmlParseOptions, PdfParseOptions, RenderExecutionOptions } from './parser';
|
|
15
|
+
export type { BrowserOutputOptions, PreviewHandle } from './runtime/browser-output';
|
|
16
|
+
export { createPrinter } from './runtime/print-renderer';
|
|
17
|
+
export type { Printer, PrintRenderer, PrintRendererOptions } from './runtime/print-renderer';
|
package/printer.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { G as e, J as t, O as n, Z as r, a as i, k as a, n as o, nt as s, r as c, t as l, vt as u } from "./elements-YX-XUHtf.js";
|
|
2
|
+
import { createPrinter as d } from "./runtime.js";
|
|
3
|
+
export { s as barcodeElement, l as builtinElements, o as createBuiltinElementRegistry, d as createPrinter, u as deserializeDocument, r as ellipseElement, t as imageElement, e as lineElement, a as qrcodeElement, n as rectElement, i as tableElement, c as textElement };
|