visio-solid-viewer 0.5.7 → 0.6.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/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mountViewer, propertyKeys } from "ooxml-ui/visio";
|
|
2
|
-
import { className, effect, style, template, use } from "solid-js/web";
|
|
2
|
+
import { className, effect, setAttribute, style, template, use } from "solid-js/web";
|
|
3
3
|
import { createEffect, createSignal, onCleanup, onMount } from "solid-js";
|
|
4
4
|
export * from "ooxml-ui/visio";
|
|
5
5
|
export * from "visio-core";
|
|
@@ -67,12 +67,36 @@ function viewerHandle(current) {
|
|
|
67
67
|
async load(source) {
|
|
68
68
|
await requireViewer().load(source);
|
|
69
69
|
},
|
|
70
|
+
async createBlankDrawing(options) {
|
|
71
|
+
await requireViewer().createBlankDrawing(options);
|
|
72
|
+
},
|
|
70
73
|
async applyEdits(edits) {
|
|
71
74
|
await requireViewer().applyEdits(edits);
|
|
72
75
|
},
|
|
76
|
+
selectShapes(shapes) {
|
|
77
|
+
requireViewer().selectShapes(shapes);
|
|
78
|
+
},
|
|
79
|
+
selectAll() {
|
|
80
|
+
requireViewer().selectAll();
|
|
81
|
+
},
|
|
82
|
+
clearSelection() {
|
|
83
|
+
requireViewer().clearSelection();
|
|
84
|
+
},
|
|
73
85
|
async replacePlainText(pageId, shapeId, text) {
|
|
74
86
|
await requireViewer().replacePlainText(pageId, shapeId, text);
|
|
75
87
|
},
|
|
88
|
+
async duplicateSelection() {
|
|
89
|
+
await requireViewer().duplicateSelection();
|
|
90
|
+
},
|
|
91
|
+
async copySelection() {
|
|
92
|
+
await requireViewer().copySelection();
|
|
93
|
+
},
|
|
94
|
+
async cutSelection() {
|
|
95
|
+
await requireViewer().cutSelection();
|
|
96
|
+
},
|
|
97
|
+
async pasteSelection() {
|
|
98
|
+
await requireViewer().pasteSelection();
|
|
99
|
+
},
|
|
76
100
|
async undo() {
|
|
77
101
|
await requireViewer().undo();
|
|
78
102
|
},
|
|
@@ -161,13 +185,15 @@ function VisioViewer(props) {
|
|
|
161
185
|
var _ref$ = host;
|
|
162
186
|
typeof _ref$ === "function" ? use(_ref$, _el$) : host = _el$;
|
|
163
187
|
effect((_p$) => {
|
|
164
|
-
var _v$ = props.class, _v$2 = props.style;
|
|
188
|
+
var _v$ = props.class, _v$2 = props.style, _v$3 = props["aria-label"];
|
|
165
189
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
166
190
|
_p$.t = style(_el$, _v$2, _p$.t);
|
|
191
|
+
_v$3 !== _p$.a && setAttribute(_el$, "aria-label", _p$.a = _v$3);
|
|
167
192
|
return _p$;
|
|
168
193
|
}, {
|
|
169
194
|
e: void 0,
|
|
170
|
-
t: void 0
|
|
195
|
+
t: void 0,
|
|
196
|
+
a: void 0
|
|
171
197
|
});
|
|
172
198
|
return _el$;
|
|
173
199
|
})();
|
package/dist/index.server.js
CHANGED
|
@@ -67,12 +67,36 @@ function viewerHandle(current) {
|
|
|
67
67
|
async load(source) {
|
|
68
68
|
await requireViewer().load(source);
|
|
69
69
|
},
|
|
70
|
+
async createBlankDrawing(options) {
|
|
71
|
+
await requireViewer().createBlankDrawing(options);
|
|
72
|
+
},
|
|
70
73
|
async applyEdits(edits) {
|
|
71
74
|
await requireViewer().applyEdits(edits);
|
|
72
75
|
},
|
|
76
|
+
selectShapes(shapes) {
|
|
77
|
+
requireViewer().selectShapes(shapes);
|
|
78
|
+
},
|
|
79
|
+
selectAll() {
|
|
80
|
+
requireViewer().selectAll();
|
|
81
|
+
},
|
|
82
|
+
clearSelection() {
|
|
83
|
+
requireViewer().clearSelection();
|
|
84
|
+
},
|
|
73
85
|
async replacePlainText(pageId, shapeId, text) {
|
|
74
86
|
await requireViewer().replacePlainText(pageId, shapeId, text);
|
|
75
87
|
},
|
|
88
|
+
async duplicateSelection() {
|
|
89
|
+
await requireViewer().duplicateSelection();
|
|
90
|
+
},
|
|
91
|
+
async copySelection() {
|
|
92
|
+
await requireViewer().copySelection();
|
|
93
|
+
},
|
|
94
|
+
async cutSelection() {
|
|
95
|
+
await requireViewer().cutSelection();
|
|
96
|
+
},
|
|
97
|
+
async pasteSelection() {
|
|
98
|
+
await requireViewer().pasteSelection();
|
|
99
|
+
},
|
|
76
100
|
async undo() {
|
|
77
101
|
await requireViewer().undo();
|
|
78
102
|
},
|
|
@@ -124,7 +148,8 @@ function viewerStateSource(current) {
|
|
|
124
148
|
var _tmpl$ = [
|
|
125
149
|
"<div",
|
|
126
150
|
" style=\"",
|
|
127
|
-
"\"
|
|
151
|
+
"\"",
|
|
152
|
+
"></div>"
|
|
128
153
|
];
|
|
129
154
|
/** Native Solid host and ownership; all document work remains in the shared binding. */
|
|
130
155
|
function VisioViewer(props) {
|
|
@@ -160,7 +185,7 @@ function VisioViewer(props) {
|
|
|
160
185
|
mounted?.destroy();
|
|
161
186
|
}
|
|
162
187
|
});
|
|
163
|
-
return ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("class", escape(props.class, true), false), ssrStyle(props.style));
|
|
188
|
+
return ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("class", escape(props.class, true), false), ssrStyle(props.style), ssrAttribute("aria-label", escape(props["aria-label"], true), false));
|
|
164
189
|
}
|
|
165
190
|
/**
|
|
166
191
|
* Reactive viewer state as a Solid accessor for a handle accessor (for example a signal set by
|
|
@@ -7,7 +7,7 @@ export type ViewerProps = {
|
|
|
7
7
|
} & {
|
|
8
8
|
events?: ViewerCallbacks | undefined;
|
|
9
9
|
};
|
|
10
|
-
export type ViewerHandle = Pick<MountedViewer, 'element' | 'controller' | 'load' | 'applyEdits' | 'replacePlainText' | 'undo' | 'redo' | 'cancelEdit' | 'exportVsdx' | 'fit' | 'setLayerVisibility' | 'resetLayerVisibility' | 'exportSvg' | 'createPrintSnapshot'>;
|
|
10
|
+
export type ViewerHandle = Pick<MountedViewer, 'element' | 'controller' | 'load' | 'createBlankDrawing' | 'applyEdits' | 'selectShapes' | 'selectAll' | 'clearSelection' | 'duplicateSelection' | 'copySelection' | 'cutSelection' | 'pasteSelection' | 'replacePlainText' | 'undo' | 'redo' | 'cancelEdit' | 'exportVsdx' | 'fit' | 'setLayerVisibility' | 'resetLayerVisibility' | 'exportSvg' | 'createPrintSnapshot'>;
|
|
11
11
|
/** One mapping for every property and event, shared by every framework adapter. */
|
|
12
12
|
export declare function viewerOptions(props: ViewerProps): ViewerOptions;
|
|
13
13
|
/**
|
|
@@ -33,8 +33,9 @@ export { mountViewer };
|
|
|
33
33
|
export type { MountedViewer, ViewerCallbacks, ViewerOptions, ViewerProperties };
|
|
34
34
|
export { eventKeys, propertyKeys };
|
|
35
35
|
export type { ViewerEvents, VsdxSource } from 'ooxml-ui/visio';
|
|
36
|
+
export type { VisioShapeSelection } from 'ooxml-ui/visio';
|
|
36
37
|
export { ViewerController, type ViewerState } from 'ooxml-ui/visio';
|
|
37
38
|
export type { SvgExportOptions, SvgExportResult } from 'ooxml-ui/visio';
|
|
38
39
|
export type { CurrentPagePrintSnapshotOptions, PrintSnapshot, PrintSnapshotPage, PrintSnapshotOptions, PrintSnapshotLimits, PrintSnapshotUsage, } from 'ooxml-ui/visio';
|
|
39
40
|
export type { ViewerEditState, VsdxExportResult } from 'ooxml-ui/visio';
|
|
40
|
-
export type { VisioEdit, VisioGeometryEdit } from 'ooxml-core/visio';
|
|
41
|
+
export type { VisioEdit, VisioGeometryEdit, CreateVsdxOptions } from 'ooxml-core/visio';
|
|
@@ -3,6 +3,7 @@ import { type ViewerHandle, type ViewerProps, type ViewerState } from './common.
|
|
|
3
3
|
export interface VisioViewerProps extends ViewerProps {
|
|
4
4
|
class?: string | undefined;
|
|
5
5
|
style?: JSX.CSSProperties | undefined;
|
|
6
|
+
'aria-label'?: string | undefined;
|
|
6
7
|
viewerRef?: ((handle: ViewerHandle | undefined) => void) | undefined;
|
|
7
8
|
}
|
|
8
9
|
/** Native Solid host and ownership; all document work remains in the shared binding. */
|
|
@@ -12,4 +13,4 @@ export declare function VisioViewer(props: VisioViewerProps): JSX.Element;
|
|
|
12
13
|
* `viewerRef`). Follows handle changes and cleans up with the owning scope.
|
|
13
14
|
*/
|
|
14
15
|
export declare function createVisioViewerState(handle: Accessor<ViewerHandle | undefined>): Accessor<ViewerState | null>;
|
|
15
|
-
export type { ViewerState, ViewerHandle, ViewerCallbacks, ViewerOptions, ViewerEvents, ViewerEditState, VsdxExportResult, } from './common.js';
|
|
16
|
+
export type { ViewerState, ViewerHandle, ViewerCallbacks, ViewerOptions, ViewerEvents, VisioShapeSelection, ViewerEditState, VsdxExportResult, } from './common.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visio-solid-viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Local-first Visio viewer for solid",
|
|
5
5
|
"homepage": "https://christophervr.github.io/ooxml/visio/",
|
|
6
6
|
"bugs": {
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"emf-converter": "4.8.21",
|
|
35
|
-
"ooxml-core": "^
|
|
36
|
-
"ooxml-ui": "^
|
|
37
|
-
"visio-core": "^0.
|
|
35
|
+
"ooxml-core": "^1.3.0",
|
|
36
|
+
"ooxml-ui": "^1.4.0",
|
|
37
|
+
"visio-core": "^0.4.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"solid-js": "^1.9.0"
|