@powerhousedao/builder-tools 4.1.0-dev.23 → 4.1.0-dev.25
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/connect-utils/vite-plugins/editors-hmr.d.ts.map +1 -1
- package/dist/connect-utils/vite-plugins/editors-hmr.js +1 -2
- package/dist/connect-utils/vite-plugins/editors-hmr.js.map +1 -1
- package/dist/connect-utils/vite-plugins/importmap.d.ts.map +1 -1
- package/dist/connect-utils/vite-plugins/importmap.js +3 -0
- package/dist/connect-utils/vite-plugins/importmap.js.map +1 -1
- package/dist/document-model-editor/document-model-editor.stories.d.ts.map +1 -1
- package/dist/document-model-editor/document-model-editor.stories.js +8 -4
- package/dist/document-model-editor/document-model-editor.stories.js.map +1 -1
- package/dist/document-model-editor/editor.d.ts +2 -2
- package/dist/document-model-editor/editor.d.ts.map +1 -1
- package/dist/document-model-editor/editor.js +63 -53
- package/dist/document-model-editor/editor.js.map +1 -1
- package/dist/document-model-editor/module.d.ts +1 -2
- package/dist/document-model-editor/module.d.ts.map +1 -1
- package/dist/document-model-editor/module.js.map +1 -1
- package/dist/document-model-editor/utils/helpers.d.ts +1 -4
- package/dist/document-model-editor/utils/helpers.d.ts.map +1 -1
- package/dist/document-model-editor/utils/helpers.js +4 -4
- package/dist/document-model-editor/utils/helpers.js.map +1 -1
- package/dist/editor-utils/storybook.d.ts +20 -11
- package/dist/editor-utils/storybook.d.ts.map +1 -1
- package/dist/editor-utils/storybook.js +14 -23
- package/dist/editor-utils/storybook.js.map +1 -1
- package/dist/style.css +7 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { type DriveEditorProps } from "@powerhousedao/reactor-browser";
|
|
2
2
|
import { type Decorator, type Meta, type StoryObj } from "@storybook/react";
|
|
3
|
-
import { type Action, type EditorProps, type
|
|
3
|
+
import { type Action, type EditorProps, type PHDocument, type Reducer } from "document-model";
|
|
4
4
|
import React from "react";
|
|
5
|
-
export type EditorStoryArgs
|
|
5
|
+
export type EditorStoryArgs = Partial<{
|
|
6
|
+
user: {
|
|
7
|
+
address: string;
|
|
8
|
+
networkId: string;
|
|
9
|
+
chainId: number;
|
|
10
|
+
ens: {
|
|
11
|
+
name: string;
|
|
12
|
+
avatarUrl: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
6
15
|
isAllowedToCreateDocuments: boolean;
|
|
7
16
|
isAllowedToEditDocuments: boolean;
|
|
8
17
|
canUndo: boolean;
|
|
@@ -13,17 +22,17 @@ export type EditorStoryArgs<TDocument extends PHDocument> = Partial<{
|
|
|
13
22
|
onShowRevisionHistory: () => void;
|
|
14
23
|
simulateBackgroundUpdates?: {
|
|
15
24
|
backgroundUpdateRate: number;
|
|
16
|
-
backgroundUpdateActions: ((document:
|
|
25
|
+
backgroundUpdateActions: ((document: PHDocument) => Action)[];
|
|
17
26
|
};
|
|
18
27
|
}>;
|
|
19
|
-
export type EditorStoryProps
|
|
20
|
-
export type DriveEditorStoryProps
|
|
21
|
-
export type EditorStoryComponent
|
|
22
|
-
export type DriveEditorStoryComponent
|
|
23
|
-
export type DocumentStory
|
|
24
|
-
export type DriveDocumentStory
|
|
25
|
-
export declare function createDocumentStory
|
|
28
|
+
export type EditorStoryProps = EditorProps & EditorStoryArgs;
|
|
29
|
+
export type DriveEditorStoryProps = DriveEditorProps & EditorStoryArgs;
|
|
30
|
+
export type EditorStoryComponent = (props: EditorStoryProps) => React.JSX.Element;
|
|
31
|
+
export type DriveEditorStoryComponent = (props: DriveEditorStoryProps) => React.JSX.Element;
|
|
32
|
+
export type DocumentStory = StoryObj<EditorStoryComponent>;
|
|
33
|
+
export type DriveDocumentStory = StoryObj<DriveEditorStoryComponent>;
|
|
34
|
+
export declare function createDocumentStory(Editor: EditorStoryComponent, reducer: Reducer<any>, initialState: unknown, additionalStoryArgs?: EditorStoryArgs, decorators?: Decorator<EditorStoryProps>[]): {
|
|
26
35
|
meta: Meta<typeof Editor>;
|
|
27
|
-
CreateDocumentStory: DocumentStory
|
|
36
|
+
CreateDocumentStory: DocumentStory;
|
|
28
37
|
};
|
|
29
38
|
//# sourceMappingURL=storybook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.d.ts","sourceRoot":"","sources":["../../editor-utils/storybook.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAEL,KAAK,MAAM,EAEX,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"storybook.d.ts","sourceRoot":"","sources":["../../editor-utils/storybook.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAEL,KAAK,MAAM,EAEX,KAAK,WAAW,EAEhB,KAAK,UAAU,EACf,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC;IACpC,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE;YACH,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,0BAA0B,EAAE,OAAO,CAAC;IACpC,wBAAwB,EAAE,OAAO,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,sBAAsB,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACjD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,yBAAyB,CAAC,EAAE;QAC1B,oBAAoB,EAAE,MAAM,CAAC;QAC7B,uBAAuB,EAAE,CAAC,CAAC,QAAQ,EAAE,UAAU,KAAK,MAAM,CAAC,EAAE,CAAC;KAC/D,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,eAAe,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG,CACjC,KAAK,EAAE,gBAAgB,KACpB,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;AAEvB,MAAM,MAAM,yBAAyB,GAAG,CACtC,KAAK,EAAE,qBAAqB,KACzB,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;AAEvB,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,yBAAyB,CAAC,CAAC;AAErE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,YAAY,EAAE,OAAO,EACrB,mBAAmB,CAAC,EAAE,eAAe,EACrC,UAAU,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,EAAE,GACzC;IACD,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAAC,CAAC;IAC1B,mBAAmB,EAAE,aAAa,CAAC;CACpC,CA0HA"}
|
|
@@ -9,12 +9,11 @@ export function createDocumentStory(Editor, reducer, initialState, additionalSto
|
|
|
9
9
|
component: Editor,
|
|
10
10
|
decorators: [
|
|
11
11
|
(Story, { args }) => {
|
|
12
|
-
const darkTheme = args.context.theme === "dark";
|
|
13
12
|
return (_jsx("div", { style: {
|
|
14
13
|
padding: "0",
|
|
15
14
|
height: "100vh",
|
|
16
|
-
color:
|
|
17
|
-
backgroundColor:
|
|
15
|
+
color: "black",
|
|
16
|
+
backgroundColor: "white",
|
|
18
17
|
}, children: _jsx(Story, {}) }));
|
|
19
18
|
},
|
|
20
19
|
(Story, { args }) => {
|
|
@@ -37,12 +36,12 @@ export function createDocumentStory(Editor, reducer, initialState, additionalSto
|
|
|
37
36
|
});
|
|
38
37
|
function dispatch(action) {
|
|
39
38
|
const context = {};
|
|
40
|
-
if (args.
|
|
39
|
+
if (args.user) {
|
|
41
40
|
context.signer = {
|
|
42
41
|
user: {
|
|
43
|
-
address: args.
|
|
44
|
-
networkId: args.
|
|
45
|
-
chainId: args.
|
|
42
|
+
address: args.user.address,
|
|
43
|
+
networkId: args.user.networkId,
|
|
44
|
+
chainId: args.user.chainId,
|
|
46
45
|
},
|
|
47
46
|
app: {
|
|
48
47
|
name: "storybook",
|
|
@@ -71,17 +70,12 @@ export function createDocumentStory(Editor, reducer, initialState, additionalSto
|
|
|
71
70
|
});
|
|
72
71
|
}
|
|
73
72
|
}, args.simulateBackgroundUpdates?.backgroundUpdateRate ?? null);
|
|
74
|
-
return
|
|
73
|
+
return _jsx(Editor, { ...args, document: document });
|
|
75
74
|
},
|
|
76
75
|
argTypes: {
|
|
77
76
|
document: {
|
|
78
77
|
control: "object",
|
|
79
78
|
},
|
|
80
|
-
dispatch: {
|
|
81
|
-
table: {
|
|
82
|
-
disable: true,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
79
|
context: {
|
|
86
80
|
theme: {
|
|
87
81
|
name: "Theme",
|
|
@@ -99,16 +93,13 @@ export function createDocumentStory(Editor, reducer, initialState, additionalSto
|
|
|
99
93
|
name: "New document",
|
|
100
94
|
args: {
|
|
101
95
|
document: baseCreateDocument(initialState),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
name: "vitalik.eth",
|
|
110
|
-
avatarUrl: "https://ipfs.io/ipfs/QmSP4nq9fnN9dAiCj42ug9Wa79rqmQerZXZch82VqpiH7U/image.gif",
|
|
111
|
-
},
|
|
96
|
+
user: {
|
|
97
|
+
address: "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
|
|
98
|
+
networkId: "eip155",
|
|
99
|
+
chainId: 1,
|
|
100
|
+
ens: {
|
|
101
|
+
name: "vitalik.eth",
|
|
102
|
+
avatarUrl: "https://ipfs.io/ipfs/QmSP4nq9fnN9dAiCj42ug9Wa79rqmQerZXZch82VqpiH7U/image.gif",
|
|
112
103
|
},
|
|
113
104
|
},
|
|
114
105
|
...additionalStoryArgs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.js","sourceRoot":"","sources":["../../editor-utils/storybook.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EACL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"storybook.js","sourceRoot":"","sources":["../../editor-utils/storybook.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EACL,kBAAkB,GAOnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA0C1C,MAAM,UAAU,mBAAmB,CACjC,MAA4B,EAC5B,OAAqB,EACrB,YAAqB,EACrB,mBAAqC,EACrC,UAA0C;IAK1C,MAAM,IAAI,GAAG;QACX,SAAS,EAAE,MA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,MAAM,CAAC;oBAC1B,YAAY,EAAE,OAAO;oBACrB,OAAO,EAAE,cAAc;iBACxB;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,QAAQ;iBAClB;aACF;SACF;KAC4B,CAAC;IAEhC,MAAM,mBAAmB,GAAkB;QACzC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE;YACJ,QAAQ,EAAE,kBAAkB,CAC1B,YAA8D,CAC/D;YACD,IAAI,EAAE;gBACJ,OAAO,EAAE,4CAA4C;gBACrD,SAAS,EAAE,QAAQ;gBACnB,OAAO,EAAE,CAAC;gBACV,GAAG,EAAE;oBACH,IAAI,EAAE,aAAa;oBACnB,SAAS,EACP,+EAA+E;iBAClF;aACF;YACD,GAAG,mBAAmB;SACvB;KACF,CAAC;IAEF,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAW,CAAC;AAChD,CAAC"}
|
package/dist/style.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.
|
|
1
|
+
/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
|
|
3
3
|
@layer properties;
|
|
4
4
|
:root {
|
|
@@ -857,6 +857,9 @@
|
|
|
857
857
|
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
|
|
858
858
|
padding-block: 0;
|
|
859
859
|
}
|
|
860
|
+
::-webkit-calendar-picker-indicator {
|
|
861
|
+
line-height: 1;
|
|
862
|
+
}
|
|
860
863
|
:-moz-ui-invalid {
|
|
861
864
|
box-shadow: none;
|
|
862
865
|
}
|
|
@@ -1510,6 +1513,9 @@ input[type="number"] {
|
|
|
1510
1513
|
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
|
|
1511
1514
|
padding-block: 0;
|
|
1512
1515
|
}
|
|
1516
|
+
::-webkit-calendar-picker-indicator {
|
|
1517
|
+
line-height: 1;
|
|
1518
|
+
}
|
|
1513
1519
|
:-moz-ui-invalid {
|
|
1514
1520
|
box-shadow: none;
|
|
1515
1521
|
}
|