@qoretechnologies/reqraft 0.10.10 → 0.10.12
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/providers/StorageProvider.d.ts.map +1 -1
- package/dist/providers/StorageProvider.js +14 -4
- package/dist/providers/StorageProvider.js.map +1 -1
- package/package.json +1 -1
- package/src/components/dpqlEditor/DpqlEditor.stories.tsx +74 -2
- package/src/components/form/engine/FormEngine.stories.tsx +654 -32
- package/src/components/form/engine/FormEngineRemote.stories.tsx +48 -0
- package/src/components/form/engine/_structuredData/StructuredDataView.stories.tsx +8 -0
- package/src/components/form/engine/variants/FormEngineVariants.stories.tsx +40 -0
- package/src/components/form/expressions/ExpressionField.stories.tsx +74 -2
- package/src/components/form/expressions/builder/ExpressionBuilder.stories.tsx +187 -0
- package/src/components/form/fields/Field.stories.tsx +40 -0
- package/src/components/form/fields/array/ArrayAutoField.stories.tsx +64 -0
- package/src/components/form/fields/auto/AutoFormField.stories.tsx +136 -0
- package/src/components/form/fields/binary/Binary.stories.tsx +32 -0
- package/src/components/form/fields/boolean/Boolean.stories.tsx +24 -0
- package/src/components/form/fields/byte-size/ByteSize.stories.tsx +24 -0
- package/src/components/form/fields/color/Color.stories.tsx +30 -0
- package/src/components/form/fields/cron/Cron.stories.tsx +8 -0
- package/src/components/form/fields/date/Date.stories.tsx +22 -0
- package/src/components/form/fields/file/File.stories.tsx +48 -0
- package/src/components/form/fields/long-string/LongString.stories.tsx +24 -0
- package/src/components/form/fields/markdown/Markdown.stories.tsx +8 -0
- package/src/components/form/fields/number/Number.stories.tsx +31 -0
- package/src/components/form/fields/object/Object.stories.tsx +88 -0
- package/src/components/form/fields/radio-group/RadioGroup.stories.tsx +24 -0
- package/src/components/form/fields/rich-text/RichText.stories.tsx +23 -0
- package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +72 -0
- package/src/components/form/fields/select/Select.stories.tsx +104 -0
- package/src/components/form/fields/string/String.stories.tsx +16 -0
- package/src/components/form/fields/template/TemplateField.stories.tsx +160 -0
- package/src/components/form/fields/url/Url.stories.tsx +24 -0
- package/src/components/log/Log.stories.tsx +96 -0
- package/src/components/menu/Menu.stories.tsx +54 -0
- package/src/components/qonsoleSmartInput/QonsoleSmartInput.stories.tsx +14 -0
- package/src/components/smartEditor/SmartEditor.stories.tsx +32 -0
- package/src/hooks/useFetch/useFetch.stories.tsx +30 -0
- package/src/hooks/useStorage/useStorage.stories.tsx +82 -0
- package/src/hooks/useWebSocket/useWebsocket.stories.tsx +127 -1
- package/src/providers/StorageProvider.tsx +12 -4
- package/src/stores/currentUser/currentUser.stories.tsx +17 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageProvider.d.ts","sourceRoot":"","sources":["../../src/providers/StorageProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AAQxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,WAAW,4BACf,SAAQ,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC;IACrD,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,mBAAmB,iCAAkC,4BAA4B,
|
|
1
|
+
{"version":3,"file":"StorageProvider.d.ts","sourceRoot":"","sources":["../../src/providers/StorageProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AAQxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,WAAW,4BACf,SAAQ,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC;IACrD,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,mBAAmB,iCAAkC,4BAA4B,4CAiF7F,CAAC"}
|
|
@@ -28,19 +28,29 @@ var ReqraftUserProvider = function (_a) {
|
|
|
28
28
|
return (_a = (0, lodash_1.get)(currentUser === null || currentUser === void 0 ? void 0 : currentUser.storage, _path)) !== null && _a !== void 0 ? _a : defaultValue;
|
|
29
29
|
}, [appName, currentUser === null || currentUser === void 0 ? void 0 : currentUser.storage]);
|
|
30
30
|
var updateStorage = (0, react_1.useCallback)(function (path, value, includeAppPrefix) {
|
|
31
|
+
var _a;
|
|
31
32
|
if (includeAppPrefix === void 0) { includeAppPrefix = true; }
|
|
32
33
|
var _path = includeAppPrefix ? "".concat(appName, ".").concat(path) : path;
|
|
33
|
-
|
|
34
|
+
// Base the write on the LATEST storage read straight from the store, not
|
|
35
|
+
// the blob captured in this callback's closure. A caller holding a stale
|
|
36
|
+
// updater — e.g. an imperative store subscription created on mount, before
|
|
37
|
+
// other keys had loaded — would otherwise persist an out-of-date blob and
|
|
38
|
+
// wipe every key written to storage since its closure was captured.
|
|
39
|
+
var latestStorage = (_a = currentUser_1.currentUserStore.getState().currentUser) === null || _a === void 0 ? void 0 : _a.storage;
|
|
40
|
+
var updatedStorage = (0, lodash_1.set)((0, lodash_1.cloneDeep)(latestStorage), _path, value);
|
|
34
41
|
updateCurrentUserStorage(updatedStorage);
|
|
35
42
|
load({ body: { storage: updatedStorage } });
|
|
36
|
-
}, [appName,
|
|
43
|
+
}, [appName, load, updateCurrentUserStorage]);
|
|
37
44
|
var removeStorageValue = (0, react_1.useCallback)(function (path, includeAppPrefix) {
|
|
45
|
+
var _a;
|
|
38
46
|
if (includeAppPrefix === void 0) { includeAppPrefix = true; }
|
|
39
47
|
var _path = includeAppPrefix ? "".concat(appName, ".").concat(path) : path;
|
|
40
|
-
|
|
48
|
+
// Same as `updateStorage`: mutate the latest blob, never a stale closure copy.
|
|
49
|
+
var latestStorage = (_a = currentUser_1.currentUserStore.getState().currentUser) === null || _a === void 0 ? void 0 : _a.storage;
|
|
50
|
+
var updatedStorage = (0, lodash_1.set)((0, lodash_1.cloneDeep)(latestStorage), _path, null);
|
|
41
51
|
updateCurrentUserStorage(updatedStorage);
|
|
42
52
|
load({ body: { storage_path: _path } });
|
|
43
|
-
}, [appName,
|
|
53
|
+
}, [appName, load, updateCurrentUserStorage]);
|
|
44
54
|
var contextValue = (0, react_1.useMemo)(function () { return ({ storage: currentUser === null || currentUser === void 0 ? void 0 : currentUser.storage, getStorage: getStorage, updateStorage: updateStorage, removeStorageValue: removeStorageValue }); }, [currentUser === null || currentUser === void 0 ? void 0 : currentUser.storage, getStorage, updateStorage, removeStorageValue]);
|
|
45
55
|
if (loading && waitForStorage) {
|
|
46
56
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageProvider.js","sourceRoot":"","sources":["../../src/providers/StorageProvider.tsx"],"names":[],"mappings":";;;;AAAA,iCAA6C;AAC7C,+BAAwD;AACxD,uCAA0C;AAE1C,6DAAoF;AACpF,uDAAsD;AACtD,kEAAiE;AAEjE,iEAAqE;AAQ9D,IAAM,mBAAmB,GAAG,UAAC,EAA0D;QAAxD,QAAQ,cAAA,EAAE,cAAc,oBAAA;IAC5D,IAAM,OAAO,GAAG,IAAA,uCAAkB,EAAC,SAAS,CAAC,CAAC;IACxC,IAAA,KAKF,IAAA,8BAAgB,GAAE,EAJpB,WAAW,iBAAA,EACI,wBAAwB,mBAAA,EACjC,eAAe,UAAA,EACrB,OAAO,aACa,CAAC;IAEvB,IAAA,yBAAa,EAAC;QACZ,eAAe,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEK,IAAA,IAAI,GAAK,IAAA,mBAAQ,EAAC;QACxB,GAAG,EAAE,kBAAkB;QACvB,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,KAAK;KACb,CAAC,KAJU,CAIT;IAEH,IAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,UACE,IAAY,EACZ,YAAe,EACf,gBAAgC;;QAAhC,iCAAA,EAAA,uBAAgC;QAEhC,IAAM,KAAK,GAAG,gBAAgB,CAAC,CAAC,CAAC,UAAG,OAAO,cAAI,IAAI,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAE7D,O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AAA,kBAAS,EAAC,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QAElE,wBAAwB,CAAC,cAAc,CAAC,CAAC;QAEzC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1C,CAAC,EACD,CAAC,OAAO,EAAE,IAAI,EAAE,wBAAwB,CAAC,CAC1C,CAAC;IAEF,IAAM,YAAY,GAAG,IAAA,eAAO,EAC1B,cAAM,OAAA,CAAC,EAAE,OAAO,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,EAAE,UAAU,YAAA,EAAE,aAAa,eAAA,EAAE,kBAAkB,oBAAA,EAAE,CAAC,EAAlF,CAAkF,EACxF,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,kBAAkB,CAAC,CACtE,CAAC;IAEF,IAAI,OAAO,IAAI,cAAc,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,uBAAC,sCAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAAG,QAAQ,GAAkC,CACjG,CAAC;AACJ,CAAC,CAAC;AAjFW,QAAA,mBAAmB,uBAiF9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qoretechnologies/reqraft",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.12",
|
|
4
4
|
"description": "ReQraft is a collection of React components and hooks that are used across Qore Technologies' products made using the ReQore component library from Qore.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -511,7 +511,15 @@ const meta = {
|
|
|
511
511
|
export default meta;
|
|
512
512
|
export type Story = StoryObj<typeof meta>;
|
|
513
513
|
|
|
514
|
-
export const Empty: Story = {
|
|
514
|
+
export const Empty: Story = {
|
|
515
|
+
parameters: {
|
|
516
|
+
docs: {
|
|
517
|
+
description: {
|
|
518
|
+
story: 'Renders the DpqlEditor with no value — the editor mounts empty and ready for input.',
|
|
519
|
+
},
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
};
|
|
515
523
|
|
|
516
524
|
/**
|
|
517
525
|
* No chips / templates — just a valid DPQL literal expression so we can
|
|
@@ -524,18 +532,42 @@ export const WithPlainText: Story = {
|
|
|
524
532
|
args: {
|
|
525
533
|
value: '1 == 1 && "hello" != "world"',
|
|
526
534
|
},
|
|
535
|
+
parameters: {
|
|
536
|
+
docs: {
|
|
537
|
+
description: {
|
|
538
|
+
story:
|
|
539
|
+
'Renders the DpqlEditor with a plain DPQL literal expression — no field references or templates, so the editor mounts as plain text with no tag chips.',
|
|
540
|
+
},
|
|
541
|
+
},
|
|
542
|
+
},
|
|
527
543
|
};
|
|
528
544
|
|
|
529
545
|
export const WithFieldReference: Story = {
|
|
530
546
|
args: {
|
|
531
547
|
value: '@name == "Alice"',
|
|
532
548
|
},
|
|
549
|
+
parameters: {
|
|
550
|
+
docs: {
|
|
551
|
+
description: {
|
|
552
|
+
story:
|
|
553
|
+
'Renders the DpqlEditor with an @name field reference — the editor mounts with a tag chip for the field and the literal string operand.',
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
},
|
|
533
557
|
};
|
|
534
558
|
|
|
535
559
|
export const WithTemplateVariable: Story = {
|
|
536
560
|
args: {
|
|
537
561
|
value: 'contains("$local:input", "es")',
|
|
538
562
|
},
|
|
563
|
+
parameters: {
|
|
564
|
+
docs: {
|
|
565
|
+
description: {
|
|
566
|
+
story:
|
|
567
|
+
'Renders the DpqlEditor with a contains() call whose first argument is a $local:input template — the template renders as a tag chip inside the call.',
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
},
|
|
539
571
|
};
|
|
540
572
|
|
|
541
573
|
export const WithMixedContent: Story = {
|
|
@@ -544,6 +576,14 @@ export const WithMixedContent: Story = {
|
|
|
544
576
|
// qore-2/design/dpql-syntax.md §"Logical Operators".
|
|
545
577
|
value: '@name == $data:{1.name} && @age > $config:min_age',
|
|
546
578
|
},
|
|
579
|
+
parameters: {
|
|
580
|
+
docs: {
|
|
581
|
+
description: {
|
|
582
|
+
story:
|
|
583
|
+
'Renders the DpqlEditor with mixed content — two @field references, two $data / $config templates and the DPQL "&&" logical operator between them, each rendered as its own chip or token.',
|
|
584
|
+
},
|
|
585
|
+
},
|
|
586
|
+
},
|
|
547
587
|
};
|
|
548
588
|
|
|
549
589
|
/**
|
|
@@ -1014,6 +1054,14 @@ export const ReadOnly: Story = {
|
|
|
1014
1054
|
value: '@name == "Alice"',
|
|
1015
1055
|
readOnly: true,
|
|
1016
1056
|
},
|
|
1057
|
+
parameters: {
|
|
1058
|
+
docs: {
|
|
1059
|
+
description: {
|
|
1060
|
+
story:
|
|
1061
|
+
'Renders the DpqlEditor with a valued expression but readOnly enabled — the field chip and literal render but the editor cannot be edited.',
|
|
1062
|
+
},
|
|
1063
|
+
},
|
|
1064
|
+
},
|
|
1017
1065
|
};
|
|
1018
1066
|
|
|
1019
1067
|
/**
|
|
@@ -1131,6 +1179,14 @@ export const CanTypeText: Story = {
|
|
|
1131
1179
|
value: '',
|
|
1132
1180
|
onChange: fn(),
|
|
1133
1181
|
},
|
|
1182
|
+
parameters: {
|
|
1183
|
+
docs: {
|
|
1184
|
+
description: {
|
|
1185
|
+
story:
|
|
1186
|
+
'Renders the empty DpqlEditor and types "hello" into it — the editor accepts the plain text and fires onChange.',
|
|
1187
|
+
},
|
|
1188
|
+
},
|
|
1189
|
+
},
|
|
1134
1190
|
play: async ({ canvasElement, args }) => {
|
|
1135
1191
|
const canvas = within(canvasElement);
|
|
1136
1192
|
|
|
@@ -1153,6 +1209,14 @@ export const LspCompletionRoundtrip: Story = {
|
|
|
1153
1209
|
value: '',
|
|
1154
1210
|
onChange: fn(),
|
|
1155
1211
|
},
|
|
1212
|
+
parameters: {
|
|
1213
|
+
docs: {
|
|
1214
|
+
description: {
|
|
1215
|
+
story:
|
|
1216
|
+
'Renders the empty DpqlEditor and types the "@" trigger — the LSP receives a textDocument/completion request against a dpql:// document URI and the dropdown mounts with the canned @name / @status / @age items.',
|
|
1217
|
+
},
|
|
1218
|
+
},
|
|
1219
|
+
},
|
|
1156
1220
|
play: async ({ canvasElement }) => {
|
|
1157
1221
|
const canvas = within(canvasElement);
|
|
1158
1222
|
|
|
@@ -1199,7 +1263,15 @@ export const LspCompletionRoundtrip: Story = {
|
|
|
1199
1263
|
* single physical connection and a single `initialize` handshake.
|
|
1200
1264
|
*/
|
|
1201
1265
|
export const TwoEditorsOneConnection: Story = {
|
|
1202
|
-
parameters: {
|
|
1266
|
+
parameters: {
|
|
1267
|
+
chromatic: { disable: true },
|
|
1268
|
+
docs: {
|
|
1269
|
+
description: {
|
|
1270
|
+
story:
|
|
1271
|
+
'Renders two DpqlEditor instances side by side — both share a single WebSocket via LspSharedConnection and each opens its own document URI, so the server sees one initialize but two didOpen notifications.',
|
|
1272
|
+
},
|
|
1273
|
+
},
|
|
1274
|
+
},
|
|
1203
1275
|
render: () => (
|
|
1204
1276
|
<>
|
|
1205
1277
|
<DpqlEditorWithState value='name' />
|