@makeswift/runtime 0.0.0-622c784 → 0.0.0-84983e3

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.
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { ElementIDValue, MarginValue, RichTextValue, WidthValue } from '../../../prop-controllers/descriptors';
3
+ import { BoxModelHandle } from '../../../box-model';
4
+ import { PropControllersHandle } from '../../../state/modules/prop-controller-handles';
5
+ declare type Props = {
6
+ id?: ElementIDValue;
7
+ text?: RichTextValue;
8
+ width?: WidthValue;
9
+ margin?: MarginValue;
10
+ };
11
+ declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<BoxModelHandle & PropControllersHandle<Props>>>;
12
+ export default _default;
13
+ //# sourceMappingURL=Text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../src/components/builtin/Text/Text.tsx"],"names":[],"mappings":";AAIA,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,UAAU,EACX,MAAM,uCAAuC,CAAA;AAG9C,OAAO,EAAE,cAAc,EAAU,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EACL,qBAAqB,EAEtB,MAAM,gDAAgD,CAAA;AAEvD,aAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,CAAA;;AAUD,wBAiDE"}
@@ -0,0 +1,2 @@
1
+ export { default } from './Text';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/builtin/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA"}
@@ -0,0 +1,286 @@
1
+ import { Props } from '@makeswift/runtime/prop-controllers';
2
+ export declare const PropControllers: {
3
+ id: {
4
+ type: "ElementID";
5
+ options: Record<string, never> | ((props: Record<string, unknown>, decideMode: Props.Device) => Record<string, never>);
6
+ };
7
+ text: {
8
+ type: "RichText";
9
+ options: {
10
+ preset?: {
11
+ object?: "value" | undefined;
12
+ annotations?: {
13
+ [x: string]: {
14
+ object?: "annotation" | undefined;
15
+ key: string;
16
+ type: string;
17
+ data?: {
18
+ [x: string]: any;
19
+ } | undefined;
20
+ anchor?: {
21
+ object?: "point" | undefined;
22
+ key?: string | undefined;
23
+ offset?: number | undefined;
24
+ path?: number[] | undefined;
25
+ } | undefined;
26
+ focus?: {
27
+ object?: "point" | undefined;
28
+ key?: string | undefined;
29
+ offset?: number | undefined;
30
+ path?: number[] | undefined;
31
+ } | undefined;
32
+ };
33
+ } | undefined;
34
+ data?: {
35
+ [x: string]: any;
36
+ } | undefined;
37
+ document?: {
38
+ object?: "document" | undefined;
39
+ nodes?: (any | {
40
+ object?: "block" | undefined;
41
+ type: string;
42
+ key?: string | undefined;
43
+ nodes?: (any | {
44
+ object?: "inline" | undefined;
45
+ type: string;
46
+ key?: string | undefined;
47
+ nodes?: (any | {
48
+ object?: "text" | undefined;
49
+ key?: string | undefined;
50
+ text?: string | undefined;
51
+ marks?: {
52
+ object?: "mark" | undefined;
53
+ type: string;
54
+ data?: {
55
+ [x: string]: any;
56
+ } | undefined;
57
+ }[] | undefined;
58
+ })[] | undefined;
59
+ data?: {
60
+ [x: string]: any;
61
+ } | undefined;
62
+ } | {
63
+ object?: "text" | undefined;
64
+ key?: string | undefined;
65
+ text?: string | undefined;
66
+ marks?: {
67
+ object?: "mark" | undefined;
68
+ type: string;
69
+ data?: {
70
+ [x: string]: any;
71
+ } | undefined;
72
+ }[] | undefined;
73
+ })[] | undefined;
74
+ data?: {
75
+ [x: string]: any;
76
+ } | undefined;
77
+ } | {
78
+ object?: "inline" | undefined;
79
+ type: string;
80
+ key?: string | undefined;
81
+ nodes?: (any | {
82
+ object?: "text" | undefined;
83
+ key?: string | undefined;
84
+ text?: string | undefined;
85
+ marks?: {
86
+ object?: "mark" | undefined;
87
+ type: string;
88
+ data?: {
89
+ [x: string]: any;
90
+ } | undefined;
91
+ }[] | undefined;
92
+ })[] | undefined;
93
+ data?: {
94
+ [x: string]: any;
95
+ } | undefined;
96
+ } | {
97
+ object?: "text" | undefined;
98
+ key?: string | undefined;
99
+ text?: string | undefined;
100
+ marks?: {
101
+ object?: "mark" | undefined;
102
+ type: string;
103
+ data?: {
104
+ [x: string]: any;
105
+ } | undefined;
106
+ }[] | undefined;
107
+ })[] | undefined;
108
+ key?: string | undefined;
109
+ data?: {
110
+ [x: string]: any;
111
+ } | undefined;
112
+ } | undefined;
113
+ selection?: {
114
+ object?: "selection" | undefined;
115
+ anchor?: {
116
+ object?: "point" | undefined;
117
+ key?: string | undefined;
118
+ offset?: number | undefined;
119
+ path?: number[] | undefined;
120
+ } | undefined;
121
+ focus?: {
122
+ object?: "point" | undefined;
123
+ key?: string | undefined;
124
+ offset?: number | undefined;
125
+ path?: number[] | undefined;
126
+ } | undefined;
127
+ isFocused?: boolean | undefined;
128
+ marks?: {
129
+ object?: "mark" | undefined;
130
+ type: string;
131
+ data?: {
132
+ [x: string]: any;
133
+ } | undefined;
134
+ }[] | undefined;
135
+ } | undefined;
136
+ } | undefined;
137
+ } | ((props: Record<string, unknown>, decideMode: Props.Device) => {
138
+ preset?: {
139
+ object?: "value" | undefined;
140
+ annotations?: {
141
+ [x: string]: {
142
+ object?: "annotation" | undefined;
143
+ key: string;
144
+ type: string;
145
+ data?: {
146
+ [x: string]: any;
147
+ } | undefined;
148
+ anchor?: {
149
+ object?: "point" | undefined;
150
+ key?: string | undefined;
151
+ offset?: number | undefined;
152
+ path?: number[] | undefined;
153
+ } | undefined;
154
+ focus?: {
155
+ object?: "point" | undefined;
156
+ key?: string | undefined;
157
+ offset?: number | undefined;
158
+ path?: number[] | undefined;
159
+ } | undefined;
160
+ };
161
+ } | undefined;
162
+ data?: {
163
+ [x: string]: any;
164
+ } | undefined;
165
+ document?: {
166
+ object?: "document" | undefined;
167
+ nodes?: (any | {
168
+ object?: "block" | undefined;
169
+ type: string;
170
+ key?: string | undefined;
171
+ nodes?: (any | {
172
+ object?: "inline" | undefined;
173
+ type: string;
174
+ key?: string | undefined;
175
+ nodes?: (any | {
176
+ object?: "text" | undefined;
177
+ key?: string | undefined;
178
+ text?: string | undefined;
179
+ marks?: {
180
+ object?: "mark" | undefined;
181
+ type: string;
182
+ data?: {
183
+ [x: string]: any;
184
+ } | undefined;
185
+ }[] | undefined;
186
+ })[] | undefined;
187
+ data?: {
188
+ [x: string]: any;
189
+ } | undefined;
190
+ } | {
191
+ object?: "text" | undefined;
192
+ key?: string | undefined;
193
+ text?: string | undefined;
194
+ marks?: {
195
+ object?: "mark" | undefined;
196
+ type: string;
197
+ data?: {
198
+ [x: string]: any;
199
+ } | undefined;
200
+ }[] | undefined;
201
+ })[] | undefined;
202
+ data?: {
203
+ [x: string]: any;
204
+ } | undefined;
205
+ } | {
206
+ object?: "inline" | undefined;
207
+ type: string;
208
+ key?: string | undefined;
209
+ nodes?: (any | {
210
+ object?: "text" | undefined;
211
+ key?: string | undefined;
212
+ text?: string | undefined;
213
+ marks?: {
214
+ object?: "mark" | undefined;
215
+ type: string;
216
+ data?: {
217
+ [x: string]: any;
218
+ } | undefined;
219
+ }[] | undefined;
220
+ })[] | undefined;
221
+ data?: {
222
+ [x: string]: any;
223
+ } | undefined;
224
+ } | {
225
+ object?: "text" | undefined;
226
+ key?: string | undefined;
227
+ text?: string | undefined;
228
+ marks?: {
229
+ object?: "mark" | undefined;
230
+ type: string;
231
+ data?: {
232
+ [x: string]: any;
233
+ } | undefined;
234
+ }[] | undefined;
235
+ })[] | undefined;
236
+ key?: string | undefined;
237
+ data?: {
238
+ [x: string]: any;
239
+ } | undefined;
240
+ } | undefined;
241
+ selection?: {
242
+ object?: "selection" | undefined;
243
+ anchor?: {
244
+ object?: "point" | undefined;
245
+ key?: string | undefined;
246
+ offset?: number | undefined;
247
+ path?: number[] | undefined;
248
+ } | undefined;
249
+ focus?: {
250
+ object?: "point" | undefined;
251
+ key?: string | undefined;
252
+ offset?: number | undefined;
253
+ path?: number[] | undefined;
254
+ } | undefined;
255
+ isFocused?: boolean | undefined;
256
+ marks?: {
257
+ object?: "mark" | undefined;
258
+ type: string;
259
+ data?: {
260
+ [x: string]: any;
261
+ } | undefined;
262
+ }[] | undefined;
263
+ } | undefined;
264
+ } | undefined;
265
+ });
266
+ };
267
+ width: {
268
+ type: "Width";
269
+ options: {
270
+ preset?: Props.WidthValue | undefined;
271
+ defaultValue?: Props.Length | undefined;
272
+ } | ((props: Record<string, unknown>, decideMode: Props.Device) => {
273
+ preset?: Props.WidthValue | undefined;
274
+ defaultValue?: Props.Length | undefined;
275
+ });
276
+ };
277
+ margin: {
278
+ type: "Margin";
279
+ options: {
280
+ preset?: Props.MarginValue | undefined;
281
+ } | ((props: Record<string, unknown>, decideMode: Props.Device) => {
282
+ preset?: Props.MarginValue | undefined;
283
+ });
284
+ };
285
+ };
286
+ //# sourceMappingURL=prop-controllers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-controllers.d.ts","sourceRoot":"","sources":["../../../../../src/components/builtin/Text/prop-controllers.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAA;AAE3D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8D3B,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { Value, ValueJSON } from 'slate';
2
+ import { Editor } from 'slate-react';
3
+ import { Controller } from '@makeswift/builder';
4
+ export declare function useRichText(controller?: Controller<ValueJSON> | {
5
+ id?: null;
6
+ value?: ValueJSON;
7
+ }): <P extends Record<string, unknown>>(props: P) => P & {
8
+ key: number;
9
+ ref: import("react").Dispatch<import("react").SetStateAction<Editor | null>>;
10
+ placeholder: string;
11
+ readOnly: boolean;
12
+ value: Value;
13
+ onChange: ({ value: nextEditorValue }: {
14
+ value: Value;
15
+ }) => void;
16
+ onFocus: () => void;
17
+ };
18
+ //# sourceMappingURL=useRichText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRichText.d.ts","sourceRoot":"","sources":["../../../../src/components/hooks/useRichText.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAKL,UAAU,EACX,MAAM,oBAAoB,CAAA;AAa3B,wBAAgB,WAAW,CACzB,UAAU,GAAE,UAAU,CAAC,SAAS,CAAC,GAAG;IAAE,EAAE,CAAC,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAO;;;;;;;eA8Id,KAAK;;;EA8CjE"}
@@ -1,2 +1,3 @@
1
1
  export * from './builtin';
2
+ export * from './utils/cssMediaRules';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,uBAAuB,CAAA"}
@@ -1,5 +1,5 @@
1
- export declare const SWATCHES_BY_ID: DocumentNode;
2
- export declare const FILE_BY_ID: DocumentNode;
3
- export declare const FILES_BY_ID: DocumentNode;
4
- export declare const PAGE_PATHNAMES_BY_ID: DocumentNode;
1
+ export declare const SWATCHES_BY_ID: import("@apollo/client").DocumentNode;
2
+ export declare const FILE_BY_ID: import("@apollo/client").DocumentNode;
3
+ export declare const FILES_BY_ID: import("@apollo/client").DocumentNode;
4
+ export declare const PAGE_PATHNAMES_BY_ID: import("@apollo/client").DocumentNode;
5
5
  //# sourceMappingURL=queries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../../src/components/utils/queries.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,cAS1B,CAAA;AAED,eAAO,MAAM,UAAU,cAatB,CAAA;AAED,eAAO,MAAM,WAAW,cAavB,CAAA;AAED,eAAO,MAAM,oBAAoB,cAOhC,CAAA"}
1
+ {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../../src/components/utils/queries.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,uCAS1B,CAAA;AAED,eAAO,MAAM,UAAU,uCAatB,CAAA;AAED,eAAO,MAAM,WAAW,uCAavB,CAAA;AAED,eAAO,MAAM,oBAAoB,uCAOhC,CAAA"}
@@ -1,10 +1,25 @@
1
- import type { Descriptor } from './descriptors';
1
+ import { Descriptor, Types } from './descriptors';
2
2
  declare type Send<T> = (message: T) => void;
3
3
  export declare abstract class PropController<T = unknown> {
4
4
  protected send: Send<T>;
5
5
  constructor(send: Send<T>);
6
6
  abstract recv(message: T): void;
7
7
  }
8
- export declare function createPropController(descriptor: Descriptor, send: (message: unknown) => void): PropController;
8
+ declare class DefaultPropController extends PropController {
9
+ recv(): void;
10
+ }
11
+ export declare type RichTextPropControllerMessage = {
12
+ type: 'PING';
13
+ } | {
14
+ type: 'PONG';
15
+ };
16
+ declare class RichTextPropController extends PropController<RichTextPropControllerMessage> {
17
+ recv(message: RichTextPropControllerMessage): void;
18
+ ping(): void;
19
+ }
20
+ export declare type DescriptorPropController<T extends Descriptor> = T extends {
21
+ type: typeof Types.RichText;
22
+ } ? RichTextPropController : DefaultPropController;
23
+ export declare function createPropController<T extends Descriptor>(descriptor: T, send: (message: unknown) => void): DescriptorPropController<T>;
9
24
  export {};
10
25
  //# sourceMappingURL=instances.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../../src/prop-controllers/instances.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,aAAK,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAA;AAEnC,8BAAsB,cAAc,CAAC,CAAC,GAAG,OAAO;IAC9C,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;gBAEX,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAIzB,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI;CAChC;AAQD,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAC/B,cAAc,CAKhB"}
1
+ {"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../../src/prop-controllers/instances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAEjD,aAAK,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAA;AAEnC,8BAAsB,cAAc,CAAC,CAAC,GAAG,OAAO;IAC9C,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;gBAEX,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAIzB,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI;CAChC;AAED,cAAM,qBAAsB,SAAQ,cAAc;IAChD,IAAI,IAAI,IAAI;CAGb;AAED,oBAAY,6BAA6B,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/E,cAAM,sBAAuB,SAAQ,cAAc,CAAC,6BAA6B,CAAC;IAChF,IAAI,CAAC,OAAO,EAAE,6BAA6B,GAAG,IAAI;IASlD,IAAI;CAGL;AAED,oBAAY,wBAAwB,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,SAAS;IACrE,IAAI,EAAE,OAAO,KAAK,CAAC,QAAQ,CAAA;CAC5B,GACG,sBAAsB,GACtB,qBAAqB,CAAA;AAEzB,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,UAAU,EACvD,UAAU,EAAE,CAAC,EACb,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAC/B,wBAAwB,CAAC,CAAC,CAAC,CAQ7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makeswift/runtime",
3
- "version": "0.0.0-622c784",
3
+ "version": "0.0.0-84983e3",
4
4
  "main": "dist/main.cjs",
5
5
  "module": "dist/main.es",
6
6
  "types": "dist/types",
@@ -53,7 +53,7 @@
53
53
  "dev": "concurrently -k 'tsc --watch --preserveWatchOutput' 'vite build --watch'",
54
54
  "build": "tsc && vite build",
55
55
  "preview": "vite preview",
56
- "deploy": "yarn publish . --new-version 0.0.0-$(git rev-parse --short HEAD) --access public",
56
+ "deploy": "yarn publish . --new-version 0.0.0-$(git rev-parse --short HEAD) --access public && git push origin main",
57
57
  "prepare": "yarn build"
58
58
  },
59
59
  "peerDependenciesMeta": {