@wix/bex-core 2.346.0 → 2.349.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/cjs/model/setupWidget.js.map +1 -1
- package/dist/cjs/state/QueryResultState.js +22 -1
- package/dist/cjs/state/QueryResultState.js.map +1 -1
- package/dist/cjs/state/WixPatternsContainer.js +1 -1
- package/dist/cjs/state/WixPatternsContainer.js.map +1 -1
- package/dist/cjs/types/FieldTypeDefinition.js +13 -0
- package/dist/cjs/types/FieldTypeDefinition.js.map +1 -1
- package/dist/cjs/types/FieldsSource.js.map +1 -1
- package/dist/esm/model/setupWidget.js +0 -8
- package/dist/esm/model/setupWidget.js.map +1 -1
- package/dist/esm/state/QueryResultState.js +23 -1
- package/dist/esm/state/QueryResultState.js.map +1 -1
- package/dist/esm/state/WixPatternsContainer.js +2 -1
- package/dist/esm/state/WixPatternsContainer.js.map +1 -1
- package/dist/esm/types/FieldTypeDefinition.js.map +1 -1
- package/dist/types/model/setupWidget.d.ts +24 -0
- package/dist/types/model/setupWidget.d.ts.map +1 -1
- package/dist/types/state/QueryResultState.d.ts +3 -0
- package/dist/types/state/QueryResultState.d.ts.map +1 -1
- package/dist/types/state/WixPatternsContainer.d.ts.map +1 -1
- package/dist/types/types/FieldTypeDefinition.d.ts +50 -1
- package/dist/types/types/FieldTypeDefinition.d.ts.map +1 -1
- package/dist/types/types/FieldsSource.d.ts +5 -0
- package/dist/types/types/FieldsSource.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/model/setupWidget.ts"],"sourcesContent":["/**\n * Public data model for the Setup widget (\"Focus Widget\").\n *\n * The widget follows the \"pluggable adapter\" design (Option C): the consumer\n * supplies a promise-returning `fetchData`, and the widget owns loading / error\n * / refetch state itself. This keeps the data source swappable (Dealer-direct,\n * patterns-service, or a static fixture) behind a single component.\n */\n\n/**\n * Server/data-derived step state only. Which step is focused/expanded is\n * presentation state the widget derives itself (first upcoming, else first\n * actionable step) — the data never pins it, matching dashboard-setup.\n */\nexport type SetupWidgetStepStatus =\n | 'upcoming'\n | 'in-progress'\n | 'completed'\n | 'disabled';\n\nexport interface SetupWidgetStep {\n /** Stable identifier, used as the React key and for inline-expansion toggling. */\n id: string;\n title: string;\n description?: string;\n /** Label for the step's call-to-action while it's still actionable. */\n ctaLabel?: string;\n /**\n * Label for the action shown on a *completed* step (e.g. \"View\", \"Manage\").\n * When set, the completed row stays actionable and clicking it fires\n * `onStepClick`. Mirrors `completedCta` in dashboard-setup. Omit to render a\n * completed step with no action (the default).\n */\n completedCtaLabel?: string;\n /**\n * Tooltip shown on a `disabled` step's CTA, explaining why it can't be acted\n * on. The only production use is permission-denied (e.g. sub-accounts that\n * lack access) — mirrors the permission tooltip in dashboard-setup. Falls\n * back to a generic \"you don't have access\" message when omitted.\n */\n disabledTooltip?: string;\n status: SetupWidgetStepStatus;\n /**\n * What happens when the row is activated:\n * - `navigate` (default when omitted): fires the consumer's `onStepClick`\n * (e.g. opens settings or the editor).\n * - `inline`: expands content in-card below the row (via the widget's\n * `renderStepContent`).\n */\n expansionMode?: 'inline' | 'navigate';\n /**\n * Nested sub-steps for an *aggregated* group (e.g. \"Stores\", \"Bookings\").\n * When present, the step renders as a collapsible group row with an \"x/y\"\n * counter; expanding it reveals the sub-steps as sub-rows. Progress (the\n * header ratio / all-complete) counts the leaves, not the group row.\n * Sub-steps should be leaf steps (`navigate` / completed) — nested inline\n * expansion is not supported. Mirrors `aggregated.steps` in dashboard-setup.\n */\n steps?: SetupWidgetStep[];\n}\n\n/** Resolved by the consumer's `fetchData`. */\nexport interface SetupWidgetData {\n /** Overrides the default \"Setup\" widget title. */\n title?: string;\n /** Ordered list of steps. Each carries its own status. */\n steps: SetupWidgetStep[];\n}\n\n/** Config shape shared by the state class and the component props. */\nexport interface SetupWidgetConfig {\n /** Consumer resolves the data; the widget owns loading / error / refetch. */\n fetchData: () => Promise<SetupWidgetData>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/model/setupWidget.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\n/**\n * Public data model for the Setup widget (\"Focus Widget\").\n *\n * The widget follows the \"pluggable adapter\" design (Option C): the consumer\n * supplies a promise-returning `fetchData`, and the widget owns loading / error\n * / refetch state itself. This keeps the data source swappable (Dealer-direct,\n * patterns-service, or a static fixture) behind a single component.\n */\n\n/**\n * Server/data-derived step state only. Which step is focused/expanded is\n * presentation state the widget derives itself (first upcoming, else first\n * actionable step) — the data never pins it, matching dashboard-setup.\n */\nexport type SetupWidgetStepStatus =\n | 'upcoming'\n | 'in-progress'\n | 'completed'\n | 'disabled';\n\n/**\n * An extra icon-only action on a step, shown next to its CTA (e.g. an AI\n * shortcut). Clicking it fires the widget's `onStepSecondaryClick`.\n */\nexport interface SetupWidgetStepSecondaryCta {\n /** Icon rendered inside the button — an icon element, e.g. `<AI />`. */\n icon: ReactNode;\n /**\n * Accessible name for the button. Required: the button renders an icon and\n * nothing else, so without it screen readers have no way to name the action.\n */\n ariaLabel: string;\n /** Tooltip shown on hover. */\n tooltip?: string;\n}\n\nexport interface SetupWidgetStep {\n /** Stable identifier, used as the React key and for inline-expansion toggling. */\n id: string;\n title: string;\n description?: string;\n /** Label for the step's call-to-action while it's still actionable. */\n ctaLabel?: string;\n /**\n * Label for the action shown on a *completed* step (e.g. \"View\", \"Manage\").\n * When set, the completed row stays actionable and clicking it fires\n * `onStepClick`. Mirrors `completedCta` in dashboard-setup. Omit to render a\n * completed step with no action (the default).\n */\n completedCtaLabel?: string;\n /**\n * Tooltip shown on a `disabled` step's CTA, explaining why it can't be acted\n * on. The only production use is permission-denied (e.g. sub-accounts that\n * lack access) — mirrors the permission tooltip in dashboard-setup. Falls\n * back to a generic \"you don't have access\" message when omitted.\n */\n disabledTooltip?: string;\n /**\n * Icon-only action rendered before the step's CTA on desktop rows — leaf\n * steps, aggregated group rows and their children alike. Mobile cards have no\n * per-step CTA and ignore it. Only offered while the step is still actionable:\n * a completed step drops it along with its CTA, and a group drops it once all\n * its children are done.\n */\n secondaryCta?: SetupWidgetStepSecondaryCta;\n status: SetupWidgetStepStatus;\n /**\n * What happens when the row is activated:\n * - `navigate` (default when omitted): fires the consumer's `onStepClick`\n * (e.g. opens settings or the editor).\n * - `inline`: expands content in-card below the row (via the widget's\n * `renderStepContent`).\n */\n expansionMode?: 'inline' | 'navigate';\n /**\n * Nested sub-steps for an *aggregated* group (e.g. \"Stores\", \"Bookings\").\n * When present, the step renders as a collapsible group row with an \"x/y\"\n * counter; expanding it reveals the sub-steps as sub-rows. Progress (the\n * header ratio / all-complete) counts the leaves, not the group row.\n * Sub-steps should be leaf steps (`navigate` / completed) — nested inline\n * expansion is not supported. Mirrors `aggregated.steps` in dashboard-setup.\n */\n steps?: SetupWidgetStep[];\n}\n\n/** Resolved by the consumer's `fetchData`. */\nexport interface SetupWidgetData {\n /** Overrides the default \"Setup\" widget title. */\n title?: string;\n /** Ordered list of steps. Each carries its own status. */\n steps: SetupWidgetStep[];\n}\n\n/** Config shape shared by the state class and the component props. */\nexport interface SetupWidgetConfig {\n /** Consumer resolves the data; the widget owns loading / error / refetch. */\n fetchData: () => Promise<SetupWidgetData>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -33,6 +33,7 @@ class QueryResultState {
|
|
|
33
33
|
processed: 0,
|
|
34
34
|
unprocessed: 0
|
|
35
35
|
});
|
|
36
|
+
(0, _defineProperty2.default)(this, "_localItemsCount", 0);
|
|
36
37
|
(0, _defineProperty2.default)(this, "_supportTotal", false);
|
|
37
38
|
(0, _defineProperty2.default)(this, "_hasNext", undefined);
|
|
38
39
|
(0, _defineProperty2.default)(this, "fetchTotal", void 0);
|
|
@@ -68,15 +69,18 @@ class QueryResultState {
|
|
|
68
69
|
total: _mobx.computed,
|
|
69
70
|
hasAvailableItems: _mobx.computed,
|
|
70
71
|
_totals: _mobx.observable.ref,
|
|
72
|
+
_localItemsCount: _mobx.observable.ref,
|
|
71
73
|
_supportTotal: _mobx.observable.ref,
|
|
72
74
|
_hasNext: _mobx.observable.ref,
|
|
73
75
|
hasNext: _mobx.computed,
|
|
74
76
|
setTotals: _mobx.action,
|
|
77
|
+
resetLocalItemsCount: _mobx.action,
|
|
75
78
|
setHasNext: _mobx.action,
|
|
76
79
|
available: _mobx.observable.ref,
|
|
77
80
|
status: _mobx.observable.ref,
|
|
78
81
|
originQuery: _mobx.observable.ref,
|
|
79
82
|
changeItems: _mobx.action,
|
|
83
|
+
incrementTotal: _mobx.action,
|
|
80
84
|
totalStatus: _mobx.computed,
|
|
81
85
|
slice: _mobx.action
|
|
82
86
|
});
|
|
@@ -141,7 +145,7 @@ class QueryResultState {
|
|
|
141
145
|
return (0, _flatMap.default)(pages);
|
|
142
146
|
}
|
|
143
147
|
get total() {
|
|
144
|
-
return this.fetchTotal ? this.fetchTotal.total : this._totals.processed;
|
|
148
|
+
return Math.max((this.fetchTotal ? this.fetchTotal.total : this._totals.processed) + this._localItemsCount, 0);
|
|
145
149
|
}
|
|
146
150
|
get totalStatus() {
|
|
147
151
|
return this.fetchTotal ? this.fetchTotal.status : this.status.status;
|
|
@@ -248,11 +252,13 @@ class QueryResultState {
|
|
|
248
252
|
} = this;
|
|
249
253
|
_pages.processed = [newItems, ..._pages.processed];
|
|
250
254
|
_pages.unprocessed = [newItems, ..._pages.unprocessed];
|
|
255
|
+
this.incrementTotal(newItems.length);
|
|
251
256
|
_pagesAtom.reportChanged();
|
|
252
257
|
return {
|
|
253
258
|
rollback: () => {
|
|
254
259
|
_pages.processed = _pages.processed.slice(1);
|
|
255
260
|
_pages.unprocessed = _pages.unprocessed.slice(1);
|
|
261
|
+
this.incrementTotal(-newItems.length);
|
|
256
262
|
_pagesAtom.reportChanged();
|
|
257
263
|
}
|
|
258
264
|
};
|
|
@@ -262,6 +268,7 @@ class QueryResultState {
|
|
|
262
268
|
processed: [],
|
|
263
269
|
unprocessed: []
|
|
264
270
|
});
|
|
271
|
+
this.resetLocalItemsCount();
|
|
265
272
|
}
|
|
266
273
|
addPages(morePages) {
|
|
267
274
|
const {
|
|
@@ -275,6 +282,19 @@ class QueryResultState {
|
|
|
275
282
|
setTotals(totals) {
|
|
276
283
|
this._totals = totals;
|
|
277
284
|
}
|
|
285
|
+
incrementTotal(delta) {
|
|
286
|
+
if (this.fetchTotal) {
|
|
287
|
+
this._localItemsCount = Math.max(this._localItemsCount + delta, 0);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
this.setTotals({
|
|
291
|
+
processed: Math.max(this._totals.processed + delta, 0),
|
|
292
|
+
unprocessed: Math.max(this._totals.unprocessed + delta, 0)
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
resetLocalItemsCount() {
|
|
296
|
+
this._localItemsCount = 0;
|
|
297
|
+
}
|
|
278
298
|
setSupportTotal(supportTotal) {
|
|
279
299
|
this._supportTotal = supportTotal;
|
|
280
300
|
}
|
|
@@ -292,6 +312,7 @@ class QueryResultState {
|
|
|
292
312
|
unprocessed: _pages.unprocessed.slice(start, end),
|
|
293
313
|
processed: _pages.processed.slice(start, end)
|
|
294
314
|
});
|
|
315
|
+
this.resetLocalItemsCount();
|
|
295
316
|
}
|
|
296
317
|
get hasAvailableItems() {
|
|
297
318
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_model","require","_mobx","_flatMap","_interopRequireDefault","QueryResultState","pages","_pagesAtom","reportObserved","_pages","processed","_keyedItemsMap","keyedItems","map","Map","keyedItem","set","key","constructor","params","_defineProperty2","default","createAtom","unprocessed","undefined","queryStatus","idle","error","isFetching","action","reportChanged","itemKey","originQuery","fetchTotal","makeObservable","items","computed","keepAlive","size","itemsKeys","fetchedAll","isEmptyAndNotFetching","asComputed","total","hasAvailableItems","_totals","observable","ref","_supportTotal","_hasNext","hasNext","setTotals","setHasNext","available","status","changeItems","totalStatus","slice","init","_this$fetchTotal","disposers","forEach","disposer","errorStatus","isError","currentIndex","flatMap","page","pageIndex","item","indexWithinPage","id","index","isSuccess","length","isEmpty","supportTotal","isLoading","get","has","createRollbackFn","updates","newItem","prevItem","newItems","find","processedPage","itemIndex","findIndex","push","rollback","addItems","clear","setNewPages","addPages","morePages","totals","setSupportTotal","setPages","start","end","hasNonPersistentActiveFilters","exports"],"sources":["../../../src/state/QueryResultState.ts"],"sourcesContent":["import {\n ComputedQueryFull,\n DataResultKeyed,\n FiltersMap,\n KeyedItem,\n QueryResult,\n QueryResultStatus,\n queryStatus,\n} from '../model';\nimport { action, computed, createAtom, makeObservable, observable } from 'mobx';\nimport flatMap from 'lodash/flatMap';\nimport { FetchTotalState } from './FetchTotalState';\n\ninterface ProcessedResult<T> {\n processed: T;\n unprocessed: T;\n}\n\ntype Pages<T> = ProcessedResult<T[][]>;\ntype Totals = ProcessedResult<number>;\n\nexport interface QueryResultStateParams<T, F extends FiltersMap> {\n itemKey: (item: T) => string;\n originQuery: ComputedQueryFull<F>;\n fetchTotal?: FetchTotalState<T, F>;\n}\n\nexport class QueryResultState<T, F extends FiltersMap>\n implements QueryResult<T>\n{\n readonly itemKey: (item: T) => string;\n\n readonly _pagesAtom = createAtom('QueryResultState.pages');\n _pages: Pages<T> = { processed: [], unprocessed: [] };\n _totals: Totals = { processed: 0, unprocessed: 0 };\n _supportTotal: boolean = false;\n _hasNext?: boolean | null = undefined;\n\n readonly fetchTotal?: FetchTotalState<T, F>;\n\n get pages() {\n this._pagesAtom.reportObserved();\n return this._pages.processed;\n }\n\n get _keyedItemsMap() {\n const { keyedItems } = this;\n const map = new Map<string, KeyedItem<T>>();\n for (const keyedItem of keyedItems) {\n map.set(keyedItem.key, keyedItem);\n }\n\n return map;\n }\n\n available: number | null = null;\n status: QueryResultStatus<DataResultKeyed<T>, unknown> = {\n ...queryStatus.idle,\n error: null,\n isFetching: false,\n };\n originQuery: ComputedQueryFull<F>;\n\n constructor(params: QueryResultStateParams<T, F>) {\n this.itemKey = params.itemKey;\n this.originQuery = params.originQuery;\n this.fetchTotal = params.fetchTotal;\n\n makeObservable(this, {\n items: computed({\n keepAlive: true,\n }),\n keyedItems: computed({\n keepAlive: true,\n }),\n _keyedItemsMap: computed,\n pages: computed,\n size: computed,\n itemsKeys: computed,\n fetchedAll: computed,\n isFetching: computed,\n isEmptyAndNotFetching: computed,\n asComputed: computed,\n total: computed,\n\n hasAvailableItems: computed,\n _totals: observable.ref,\n _supportTotal: observable.ref,\n _hasNext: observable.ref,\n hasNext: computed,\n setTotals: action,\n setHasNext: action,\n available: observable.ref,\n status: observable.ref,\n originQuery: observable.ref,\n changeItems: action,\n totalStatus: computed,\n slice: action,\n });\n }\n\n init() {\n const disposers = [this.fetchTotal?.init()];\n\n return () => {\n disposers.forEach((disposer) => disposer?.());\n };\n }\n\n get errorStatus() {\n const { status } = this;\n return status.isError ? status : null;\n }\n\n private setNewPages = action((pages: Pages<T>) => {\n this._pages = pages;\n this._pagesAtom.reportChanged();\n });\n\n get keyedItems(): KeyedItem<T>[] {\n this._pagesAtom.reportObserved();\n const { pages, itemKey } = this;\n let currentIndex = 0;\n return flatMap(pages, (page, pageIndex) => {\n return page.map((item, indexWithinPage) => {\n const key = itemKey(item);\n return {\n key,\n id: key,\n item,\n index: currentIndex++,\n pageIndex,\n indexWithinPage,\n };\n });\n });\n }\n\n get itemsKeys() {\n return this.keyedItems.map(({ key }) => key);\n }\n\n get isEmptyAndNotFetching() {\n const { status, keyedItems } = this;\n return status.isSuccess && !status.isFetching && !keyedItems.length;\n }\n\n get isEmpty() {\n const { keyedItems } = this;\n return keyedItems.length === 0;\n }\n\n get items(): T[] {\n this._pagesAtom.reportObserved();\n const { pages } = this;\n return flatMap(pages);\n }\n\n get total() {\n return this.fetchTotal ? this.fetchTotal.total : this._totals.processed;\n }\n\n get totalStatus() {\n return this.fetchTotal ? this.fetchTotal.status : this.status.status;\n }\n\n get supportTotal() {\n return !!this.fetchTotal || this._supportTotal;\n }\n\n get hasNext() {\n return this._hasNext;\n }\n\n get fetchedAll() {\n const { status, items, total } = this;\n return !status.isLoading && total <= items.length;\n }\n\n get isFetching() {\n return this.status.isFetching;\n }\n\n get(key: string) {\n this._pagesAtom.reportObserved();\n return this._keyedItemsMap.get(key);\n }\n\n has(key: string) {\n return this._keyedItemsMap.has(key);\n }\n\n private createRollbackFn(updates: { prevItem: T; newItem: T }[]) {\n return () => {\n const { itemKey, _keyedItemsMap, pages } = this;\n for (const { newItem, prevItem } of updates) {\n const key = itemKey(newItem);\n const keyedItem = _keyedItemsMap.get(key);\n // the current item is still the one that was recently updated\n if (keyedItem != null) {\n const { pageIndex, indexWithinPage } = keyedItem;\n const page = pages[pageIndex];\n if (page[indexWithinPage] === newItem) {\n this.changeItems([prevItem]);\n return true;\n }\n }\n }\n\n return false;\n };\n }\n\n changeItems(newItems: T[]) {\n const { itemKey, _pages, _pagesAtom, keyedItems } = this;\n const updates: { prevItem: T; newItem: T }[] = [];\n for (const newItem of newItems) {\n const key = itemKey(newItem);\n const keyedItem = keyedItems.find((item) => item.key === key);\n if (keyedItem != null) {\n const { pageIndex, indexWithinPage } = keyedItem;\n const processedPage = _pages.processed[pageIndex];\n // this mutates react-query cache since `page` is the same reference of the cached data\n // this behavior is intentional because the strategy is to assume the server will be update correctly in the next invalidation\n // until then, we simulate locally (cache) what we expect the server state eventually to be\n const prevItem = processedPage[indexWithinPage];\n processedPage[indexWithinPage] = newItem;\n\n _pages.unprocessed.forEach((page) => {\n const itemIndex = page.findIndex((item) => itemKey(item) === key);\n if (itemIndex !== -1) {\n page[itemIndex] = newItem;\n }\n });\n\n updates.push({ prevItem, newItem });\n }\n }\n\n if (updates.length) {\n _pagesAtom.reportChanged();\n\n return {\n rollback: this.createRollbackFn(updates),\n };\n }\n\n return undefined;\n }\n\n addItems(newItems: T[]) {\n const { _pages, _pagesAtom } = this;\n _pages.processed = [newItems, ..._pages.processed];\n _pages.unprocessed = [newItems, ..._pages.unprocessed];\n _pagesAtom.reportChanged();\n\n return {\n rollback: () => {\n _pages.processed = _pages.processed.slice(1);\n _pages.unprocessed = _pages.unprocessed.slice(1);\n _pagesAtom.reportChanged();\n },\n };\n }\n\n clear() {\n this.setNewPages({ processed: [], unprocessed: [] });\n }\n\n addPages(morePages: Pages<T>) {\n const { _pages } = this;\n this.setNewPages({\n unprocessed: [..._pages.unprocessed, ...morePages.unprocessed],\n processed: [..._pages.processed, ...morePages.processed],\n });\n }\n\n setTotals(totals: Totals) {\n this._totals = totals;\n }\n\n setSupportTotal(supportTotal: boolean) {\n this._supportTotal = supportTotal;\n }\n\n setHasNext(hasNext?: boolean | null) {\n this._hasNext = hasNext;\n }\n\n setPages(pages: Pages<T>) {\n this.setNewPages(pages);\n }\n\n slice(start?: number, end?: number) {\n const { _pages } = this;\n this.setNewPages({\n unprocessed: _pages.unprocessed.slice(start, end),\n processed: _pages.processed.slice(start, end),\n });\n }\n\n get hasAvailableItems() {\n const {\n originQuery: { hasNonPersistentActiveFilters },\n available,\n total,\n size,\n } = this;\n // if `available` info is missing, must assume that there are available items if non persistent filters are active\n return available != null\n ? available > 0\n : hasNonPersistentActiveFilters || total > 0 || size > 0;\n }\n\n get asComputed() {\n const { total, available } = this;\n return {\n total,\n available: available ?? 0,\n };\n }\n\n get size() {\n return this.items.length;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AASA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AAiBO,MAAMI,gBAAgB,CAE7B;EAWE,IAAIC,KAAKA,CAAA,EAAG;IACV,IAAI,CAACC,UAAU,CAACC,cAAc,CAAC,CAAC;IAChC,OAAO,IAAI,CAACC,MAAM,CAACC,SAAS;EAC9B;EAEA,IAAIC,cAAcA,CAAA,EAAG;IACnB,MAAM;MAAEC;IAAW,CAAC,GAAG,IAAI;IAC3B,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAAuB,CAAC;IAC3C,KAAK,MAAMC,SAAS,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ACH;EAEA,IAAIf,IAAIA,CAAA,EAAG;IACT,OAAO,IAAI,CAACH,KAAK,CAACuC,MAAM;EAC1B;AACF;AAAC4B,OAAA,CAAAjG,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_model","require","_mobx","_flatMap","_interopRequireDefault","QueryResultState","pages","_pagesAtom","reportObserved","_pages","processed","_keyedItemsMap","keyedItems","map","Map","keyedItem","set","key","constructor","params","_defineProperty2","default","createAtom","unprocessed","undefined","queryStatus","idle","error","isFetching","action","reportChanged","itemKey","originQuery","fetchTotal","makeObservable","items","computed","keepAlive","size","itemsKeys","fetchedAll","isEmptyAndNotFetching","asComputed","total","hasAvailableItems","_totals","observable","ref","_localItemsCount","_supportTotal","_hasNext","hasNext","setTotals","resetLocalItemsCount","setHasNext","available","status","changeItems","incrementTotal","totalStatus","slice","init","_this$fetchTotal","disposers","forEach","disposer","errorStatus","isError","currentIndex","flatMap","page","pageIndex","item","indexWithinPage","id","index","isSuccess","length","isEmpty","Math","max","supportTotal","isLoading","get","has","createRollbackFn","updates","newItem","prevItem","newItems","find","processedPage","itemIndex","findIndex","push","rollback","addItems","clear","setNewPages","addPages","morePages","totals","delta","setSupportTotal","setPages","start","end","hasNonPersistentActiveFilters","exports"],"sources":["../../../src/state/QueryResultState.ts"],"sourcesContent":["import {\n ComputedQueryFull,\n DataResultKeyed,\n FiltersMap,\n KeyedItem,\n QueryResult,\n QueryResultStatus,\n queryStatus,\n} from '../model';\nimport { action, computed, createAtom, makeObservable, observable } from 'mobx';\nimport flatMap from 'lodash/flatMap';\nimport { FetchTotalState } from './FetchTotalState';\n\ninterface ProcessedResult<T> {\n processed: T;\n unprocessed: T;\n}\n\ntype Pages<T> = ProcessedResult<T[][]>;\ntype Totals = ProcessedResult<number>;\n\nexport interface QueryResultStateParams<T, F extends FiltersMap> {\n itemKey: (item: T) => string;\n originQuery: ComputedQueryFull<F>;\n fetchTotal?: FetchTotalState<T, F>;\n}\n\nexport class QueryResultState<T, F extends FiltersMap>\n implements QueryResult<T>\n{\n readonly itemKey: (item: T) => string;\n\n readonly _pagesAtom = createAtom('QueryResultState.pages');\n _pages: Pages<T> = { processed: [], unprocessed: [] };\n _totals: Totals = { processed: 0, unprocessed: 0 };\n _localItemsCount = 0;\n _supportTotal: boolean = false;\n _hasNext?: boolean | null = undefined;\n\n readonly fetchTotal?: FetchTotalState<T, F>;\n\n get pages() {\n this._pagesAtom.reportObserved();\n return this._pages.processed;\n }\n\n get _keyedItemsMap() {\n const { keyedItems } = this;\n const map = new Map<string, KeyedItem<T>>();\n for (const keyedItem of keyedItems) {\n map.set(keyedItem.key, keyedItem);\n }\n\n return map;\n }\n\n available: number | null = null;\n status: QueryResultStatus<DataResultKeyed<T>, unknown> = {\n ...queryStatus.idle,\n error: null,\n isFetching: false,\n };\n originQuery: ComputedQueryFull<F>;\n\n constructor(params: QueryResultStateParams<T, F>) {\n this.itemKey = params.itemKey;\n this.originQuery = params.originQuery;\n this.fetchTotal = params.fetchTotal;\n\n makeObservable(this, {\n items: computed({\n keepAlive: true,\n }),\n keyedItems: computed({\n keepAlive: true,\n }),\n _keyedItemsMap: computed,\n pages: computed,\n size: computed,\n itemsKeys: computed,\n fetchedAll: computed,\n isFetching: computed,\n isEmptyAndNotFetching: computed,\n asComputed: computed,\n total: computed,\n\n hasAvailableItems: computed,\n _totals: observable.ref,\n _localItemsCount: observable.ref,\n _supportTotal: observable.ref,\n _hasNext: observable.ref,\n hasNext: computed,\n setTotals: action,\n resetLocalItemsCount: action,\n setHasNext: action,\n available: observable.ref,\n status: observable.ref,\n originQuery: observable.ref,\n changeItems: action,\n incrementTotal: action,\n totalStatus: computed,\n slice: action,\n });\n }\n\n init() {\n const disposers = [this.fetchTotal?.init()];\n\n return () => {\n disposers.forEach((disposer) => disposer?.());\n };\n }\n\n get errorStatus() {\n const { status } = this;\n return status.isError ? status : null;\n }\n\n private setNewPages = action((pages: Pages<T>) => {\n this._pages = pages;\n this._pagesAtom.reportChanged();\n });\n\n get keyedItems(): KeyedItem<T>[] {\n this._pagesAtom.reportObserved();\n const { pages, itemKey } = this;\n let currentIndex = 0;\n return flatMap(pages, (page, pageIndex) => {\n return page.map((item, indexWithinPage) => {\n const key = itemKey(item);\n return {\n key,\n id: key,\n item,\n index: currentIndex++,\n pageIndex,\n indexWithinPage,\n };\n });\n });\n }\n\n get itemsKeys() {\n return this.keyedItems.map(({ key }) => key);\n }\n\n get isEmptyAndNotFetching() {\n const { status, keyedItems } = this;\n return status.isSuccess && !status.isFetching && !keyedItems.length;\n }\n\n get isEmpty() {\n const { keyedItems } = this;\n return keyedItems.length === 0;\n }\n\n get items(): T[] {\n this._pagesAtom.reportObserved();\n const { pages } = this;\n return flatMap(pages);\n }\n\n get total() {\n return Math.max(\n (this.fetchTotal ? this.fetchTotal.total : this._totals.processed) +\n this._localItemsCount,\n 0,\n );\n }\n\n get totalStatus() {\n return this.fetchTotal ? this.fetchTotal.status : this.status.status;\n }\n\n get supportTotal() {\n return !!this.fetchTotal || this._supportTotal;\n }\n\n get hasNext() {\n return this._hasNext;\n }\n\n get fetchedAll() {\n const { status, items, total } = this;\n return !status.isLoading && total <= items.length;\n }\n\n get isFetching() {\n return this.status.isFetching;\n }\n\n get(key: string) {\n this._pagesAtom.reportObserved();\n return this._keyedItemsMap.get(key);\n }\n\n has(key: string) {\n return this._keyedItemsMap.has(key);\n }\n\n private createRollbackFn(updates: { prevItem: T; newItem: T }[]) {\n return () => {\n const { itemKey, _keyedItemsMap, pages } = this;\n for (const { newItem, prevItem } of updates) {\n const key = itemKey(newItem);\n const keyedItem = _keyedItemsMap.get(key);\n // the current item is still the one that was recently updated\n if (keyedItem != null) {\n const { pageIndex, indexWithinPage } = keyedItem;\n const page = pages[pageIndex];\n if (page[indexWithinPage] === newItem) {\n this.changeItems([prevItem]);\n return true;\n }\n }\n }\n\n return false;\n };\n }\n\n changeItems(newItems: T[]) {\n const { itemKey, _pages, _pagesAtom, keyedItems } = this;\n const updates: { prevItem: T; newItem: T }[] = [];\n for (const newItem of newItems) {\n const key = itemKey(newItem);\n const keyedItem = keyedItems.find((item) => item.key === key);\n if (keyedItem != null) {\n const { pageIndex, indexWithinPage } = keyedItem;\n const processedPage = _pages.processed[pageIndex];\n // this mutates react-query cache since `page` is the same reference of the cached data\n // this behavior is intentional because the strategy is to assume the server will be update correctly in the next invalidation\n // until then, we simulate locally (cache) what we expect the server state eventually to be\n const prevItem = processedPage[indexWithinPage];\n processedPage[indexWithinPage] = newItem;\n\n _pages.unprocessed.forEach((page) => {\n const itemIndex = page.findIndex((item) => itemKey(item) === key);\n if (itemIndex !== -1) {\n page[itemIndex] = newItem;\n }\n });\n\n updates.push({ prevItem, newItem });\n }\n }\n\n if (updates.length) {\n _pagesAtom.reportChanged();\n\n return {\n rollback: this.createRollbackFn(updates),\n };\n }\n\n return undefined;\n }\n\n addItems(newItems: T[]) {\n const { _pages, _pagesAtom } = this;\n _pages.processed = [newItems, ..._pages.processed];\n _pages.unprocessed = [newItems, ..._pages.unprocessed];\n this.incrementTotal(newItems.length);\n _pagesAtom.reportChanged();\n\n return {\n rollback: () => {\n _pages.processed = _pages.processed.slice(1);\n _pages.unprocessed = _pages.unprocessed.slice(1);\n this.incrementTotal(-newItems.length);\n _pagesAtom.reportChanged();\n },\n };\n }\n\n clear() {\n this.setNewPages({ processed: [], unprocessed: [] });\n this.resetLocalItemsCount();\n }\n\n addPages(morePages: Pages<T>) {\n const { _pages } = this;\n this.setNewPages({\n unprocessed: [..._pages.unprocessed, ...morePages.unprocessed],\n processed: [..._pages.processed, ...morePages.processed],\n });\n }\n\n setTotals(totals: Totals) {\n this._totals = totals;\n }\n\n incrementTotal(delta: number) {\n if (this.fetchTotal) {\n this._localItemsCount = Math.max(this._localItemsCount + delta, 0);\n return;\n }\n\n this.setTotals({\n processed: Math.max(this._totals.processed + delta, 0),\n unprocessed: Math.max(this._totals.unprocessed + delta, 0),\n });\n }\n\n resetLocalItemsCount() {\n this._localItemsCount = 0;\n }\n\n setSupportTotal(supportTotal: boolean) {\n this._supportTotal = supportTotal;\n }\n\n setHasNext(hasNext?: boolean | null) {\n this._hasNext = hasNext;\n }\n\n setPages(pages: Pages<T>) {\n this.setNewPages(pages);\n }\n\n slice(start?: number, end?: number) {\n const { _pages } = this;\n this.setNewPages({\n unprocessed: _pages.unprocessed.slice(start, end),\n processed: _pages.processed.slice(start, end),\n });\n this.resetLocalItemsCount();\n }\n\n get hasAvailableItems() {\n const {\n originQuery: { hasNonPersistentActiveFilters },\n available,\n total,\n size,\n } = this;\n // if `available` info is missing, must assume that there are available items if non persistent filters are active\n return available != null\n ? available > 0\n : hasNonPersistentActiveFilters || total > 0 || size > 0;\n }\n\n get asComputed() {\n const { total, available } = this;\n return {\n total,\n available: available ?? 0,\n };\n }\n\n get size() {\n return this.items.length;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AASA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AAiBO,MAAMI,gBAAgB,CAE7B;EAYE,IAAIC,KAAKA,CAAA,EAAG;IACV,IAAI,CAACC,UAAU,CAACC,cAAc,CAAC,CAAC;IAChC,OAAO,IAAI,CAACC,MAAM,CAACC,SAAS;EAC9B;EAEA,IAAIC,cAAcA,CAAA,EAAG;IACnB,MAAM;MAAEC;IAAW,CAAC,GAAG,IAAI;IAC3B,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAAuB,CAAC;IAC3C,KAAK,MAAMC,SAAS,IAAIH,UAAU,EAAE;MAClCC,GAAG,CAACG,GAAG,CAACD,SAAS,CAACE,GAAG,EAAEF,SAAS,CAAC;IACnC;IAEA,OAAOF,GAAG;EACZ;EAUAK,WAAWA,CAACC,MAAoC,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,sBAhC5B,IAAAC,gBAAU,EAAC,wBAAwB,CAAC;IAAA,IAA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AAI;IACvB,IAAI,CAACyF,WAAW,CAAC;MACf3E,WAAW,EAAEd,MAAM,CAACc,WAAW,CAACqC,KAAK,CAAC6C,KAAK,EAAEC,GAAG,CAAC;MACjDhG,SAAS,EAAED,MAAM,CAACC,SAAS,CAACkD,KAAK,CAAC6C,KAAK,EAAEC,GAAG;IAC9C,CAAC,CAAC;IACF,IAAI,CAACrD,oBAAoB,CAAC,CAAC;EAC7B;EAEA,IAAIT,iBAAiBA,CAAA,EAAG;IACtB,MAAM;MACJZ,WAAW,EAAE;QAAE2E;MAA8B,CAAC;MAC9CpD,SAAS;MACTZ,KAAK;MACLL;IACF,CAAC,GAAG,IAAI;IACR;IACA,OAAOiB,SAAS,IAAI,IAAI,GACpBA,SAAS,GAAG,CAAC,GACboD,6BAA6B,IAAIhE,KAAK,GAAG,CAAC,IAAIL,IAAI,GAAG,CAAC;EAC5D;EAEA,IAAII,UAAUA,CAAA,EAAG;IACf,MAAM;MAAEC,KAAK;MAAEY;IAAU,CAAC,GAAG,IAAI;IACjC,OAAO;MACLZ,KAAK;MACLY,SAAS,EAAEA,SAAS,IAAI;IAC1B,CAAC;EACH;EAEA,IAAIjB,IAAIA,CAAA,EAAG;IACT,OAAO,IAAI,CAACH,KAAK,CAAC0C,MAAM;EAC1B;AACF;AAAC+B,OAAA,CAAAvG,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -309,7 +309,7 @@ class WixPatternsContainer {
|
|
|
309
309
|
}
|
|
310
310
|
get useRelativeSidePanel() {
|
|
311
311
|
var _this$internalExperim;
|
|
312
|
-
return this._useRelativeSidePanel || ((_this$internalExperim = this.internalExperiments) == null ? void 0 : _this$internalExperim.enabled('
|
|
312
|
+
return this._useRelativeSidePanel || ((_this$internalExperim = this.internalExperiments) == null ? void 0 : _this$internalExperim.enabled('useRelativeSidePanel')) && this.experiments.enabled('bmHarmonyTheme');
|
|
313
313
|
}
|
|
314
314
|
init() {
|
|
315
315
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_services","require","_model","_mobx","_TaskState","_OnlineState","_createComponentSettings","_ConditionalModalState","_events","_util","_useExperimentsCompat","_uuid","_BeforeUnloadCompatState","WixPatternsContainer","constructor","params","_params$initialProps","_defineProperty2","default","TaskState","defaultParams","reportProps","environment","environmentBI","cairoSessionId","biLogger","user","url","rest","report","msid","id","uuid","artifactId","artifactIdNew","componentName","componentIdNew","componentId","cairoVersion","uiLibVersion","csid","providerType","_hostingPlatform","isAutoPatterns","_isAutoPatterns","fixDomainForBI","createEssentials","lodash","patchesCache","events","EventEmitter","_messagesEnImport","messagesEnImport","messagesEnImportGlobal","_fetchTranslations","fetchTranslations","onNavigationModal","ConditionalModalState","wixPatternsEnvironment","contextType","createComponentSettings","errorMonitor","errorHandler","withErrorHandler","fn","getResolvedError","translate","t","message","showError","_this$showToast","showToast","call","type","httpClient","onlineManager","focusManager","history","useTranslation","useExperiments","createUseExperimentsCompat","experiments","usePageLocation","navigateTo","onNavigation","getHostContainer","window","queryCache","appendModalsToBody","layoutType","_useRelativeSidePanel","useRelativeSidePanel","onSidePanelOpen","closeSidePanel","onBeforeUnload","onLayerStateChange","openMediaManager","i18n","biLoggerFactory","fedopsLogger","internalFedops","internalErrorMonitor","internalExperiments","useSuspense","disableAutoInit","asyncMessagesLoader","locale","messages","initialProps","dsn","process","env","NODE_ENV","fedops","appName","scopes","STORYBOOK_VISUAL_E2E","options","fallbackLng","logger","internalMonitor","WixPatternsMonitor","enableTranslatedKeySuffix","enabled","key","initTask","status","defaultValue","Trans","onlineState","OnlineState","reportBi","createBILogger","makeObservable","init","action","bound","initialFetch","dateFormatters","computed","isPanelLayout","_isMobile","observable","ref","isMobileDevice","setIsAutoPatterns","value","runOnce","Promise","all","ready","catch","e","console","error","promise","medium","Intl","DateTimeFormat","language","dateStyle","mediumTime","timeStyle","time","isMobile","_this$internalExperim","disposers","BeforeUnloadCompatState","forEach","d","exports"],"sources":["../../../src/state/WixPatternsContainer.ts"],"sourcesContent":["import type { Essentials } from '@wix/fe-essentials/core';\nimport type { Trans, useTranslation } from '@wix/fe-essentials/react';\nimport type { ReportProps } from '@wix/fe-essentials/bi';\nimport {\n Environment,\n EnvironmentBi,\n ErrorMonitor,\n fetchTranslations,\n FocusManager,\n History,\n messagesEnImportGlobal,\n ModalLayoutProps,\n OnlineManager,\n PartialLodash,\n PartialWindow,\n ReportBI,\n Translate,\n WixPatternsMonitor,\n} from '../services';\nimport { QueryCache } from 'react-query/core';\nimport {\n CloseSidePanel,\n ContextType,\n GetHostContainer,\n OnNavigation,\n OnSidePanelOpen,\n PatternsErrorHandler,\n ShowToast,\n wixPatternsEnvironment,\n WixPatternsEssentials,\n WixPatternsInitialProps,\n} from '../model';\nimport {\n action,\n computed,\n IObservableArray,\n makeObservable,\n observable,\n} from 'mobx';\nimport { TaskState } from './TaskState';\nimport { OnlineState } from './OnlineState';\nimport { createComponentSettings } from '../services/createComponentSettings';\nimport { OptimisticPatch } from './CollectionOptimisticPatch';\nimport { ConditionalModalState } from './ConditionalModalState';\nimport { EventEmitter } from 'events';\nimport { fixDomainForBI, isMobileDevice, TypedEmitter } from '../util';\nimport { TransitionState } from './TransitionState';\nimport { ReactElement } from 'react';\nimport { createUseExperimentsCompat } from './useExperimentsCompat';\nimport { v4 as uuid } from 'uuid';\nimport { BeforeUnloadCompatState } from './BeforeUnloadCompatState';\nimport type { errorHandler } from '@wix/essentials';\nimport { PatternsLayoutType } from '../model/PatternsLayoutType';\n\ntype WixPatternsContainerEvents = TypedEmitter<{\n navigation: () => ModalLayoutProps | null | undefined;\n}>;\n\nexport interface WixPatternsContainerParams {\n readonly initialProps?: WixPatternsInitialProps;\n readonly createEssentials: WixPatternsEssentials['createEssentials'];\n readonly biLogger?: WixPatternsEssentials['biLogger'];\n readonly messagesEnImport?: () => Promise<{}>;\n readonly fetchTranslations?: (p: {\n readonly errorMonitor: ErrorMonitor;\n }) => (locale: string) => Promise<{}>;\n readonly createComponentSettings?: WixPatternsEssentials['createComponentSettings'];\n readonly errorMonitor: ErrorMonitor;\n readonly httpClient: WixPatternsEssentials['httpClient'];\n readonly onlineManager: OnlineManager;\n readonly focusManager: FocusManager;\n readonly contextType?: ContextType;\n readonly history: History;\n readonly window: PartialWindow;\n readonly useTranslation: typeof useTranslation;\n readonly Trans: typeof Trans;\n readonly useExperiments: WixPatternsEssentials['useExperiments'];\n readonly experiments: WixPatternsEssentials['experiments'];\n readonly environment: WixPatternsEssentials['environment'];\n readonly environmentBI: WixPatternsEssentials['environmentBI'];\n readonly errorHandler?: WixPatternsEssentials['errorHandler'];\n readonly user: WixPatternsEssentials['user'];\n readonly showToast?: ShowToast;\n readonly usePageLocation?: WixPatternsEssentials['usePageLocation'];\n readonly navigateTo?: WixPatternsEssentials['navigateTo'];\n readonly onNavigation?: OnNavigation;\n readonly getHostContainer?: GetHostContainer;\n readonly queryCache: QueryCache;\n readonly patchesCache: Map<string, IObservableArray<OptimisticPatch<any>>>;\n readonly onSidePanelOpen?: OnSidePanelOpen;\n readonly closeSidePanel?: CloseSidePanel;\n readonly lodash: PartialLodash;\n readonly events?: WixPatternsContainerEvents;\n readonly sidePanel?: TransitionState<string>;\n readonly onNavigationModal?: ConditionalModalState<ModalLayoutProps>;\n readonly sidePanelComponents?: Map<string, ReactElement>;\n readonly appendModalsToBody?: boolean;\n readonly layoutType?: PatternsLayoutType;\n readonly useRelativeSidePanel?: boolean;\n readonly onBeforeUnload?: WixPatternsEssentials['onBeforeUnload'];\n readonly onLayerStateChange?: WixPatternsEssentials['onLayerStateChange'];\n readonly openMediaManager?: WixPatternsEssentials['openMediaManager'];\n}\n\nexport class WixPatternsContainer {\n readonly createEssentials;\n readonly errorMonitor: WixPatternsContainerParams['errorMonitor'];\n readonly errorHandler: PatternsErrorHandler;\n readonly internalMonitor: WixPatternsMonitor;\n readonly internalExperiments;\n readonly experiments: WixPatternsContainerParams['experiments'];\n readonly httpClient: WixPatternsContainerParams['httpClient'];\n readonly onlineManager;\n readonly focusManager;\n readonly contextType: ContextType;\n readonly history: WixPatternsContainerParams['history'];\n readonly window: WixPatternsContainerParams['window'];\n readonly useTranslation;\n readonly Trans: typeof Trans;\n readonly useExperiments;\n readonly showToast?;\n readonly usePageLocation?;\n readonly navigateTo?;\n readonly onNavigation;\n readonly onBeforeUnload;\n readonly onLayerStateChange?: WixPatternsEssentials['onLayerStateChange'];\n readonly openMediaManager?: WixPatternsEssentials['openMediaManager'];\n readonly getHostContainer;\n readonly environment: Environment;\n readonly environmentBI: EnvironmentBi;\n readonly appendModalsToBody?: boolean;\n readonly layoutType?: string;\n readonly _useRelativeSidePanel?: boolean;\n\n readonly onSidePanelOpen?: OnSidePanelOpen;\n readonly closeSidePanel?: CloseSidePanel;\n readonly translate: Translate;\n readonly lodash;\n readonly i18n: Essentials['i18n'];\n readonly reportBi: ReportBI;\n readonly _messagesEnImport;\n readonly _fetchTranslations;\n\n queryCache: QueryCache;\n readonly patchesCache;\n\n readonly initTask = new TaskState<void>();\n readonly onlineState: OnlineState;\n\n readonly onNavigationModal;\n\n readonly events: TypedEmitter<{\n navigation: () => ModalLayoutProps | null | undefined;\n }>;\n\n readonly user;\n\n readonly cairoSessionId: string;\n\n readonly biLogger;\n\n readonly createComponentSettings;\n\n readonly enableTranslatedKeySuffix: boolean;\n\n private _isAutoPatterns: boolean = false;\n\n // CAIRO-3582: modify mobile detection to use user agent\n _isMobile = false;\n\n constructor(params: Readonly<WixPatternsContainerParams>) {\n this.createEssentials = params.createEssentials;\n this.lodash = params.lodash;\n this.patchesCache = params.patchesCache;\n this.events =\n params.events ?? (new EventEmitter() as WixPatternsContainerEvents);\n this._messagesEnImport = params.messagesEnImport ?? messagesEnImportGlobal;\n this._fetchTranslations = params.fetchTranslations ?? fetchTranslations;\n\n this.onNavigationModal =\n params.onNavigationModal ?? new ConditionalModalState();\n\n this.environment = wixPatternsEnvironment(params.environment);\n this.environmentBI = params.environmentBI;\n this.user = params.user;\n this.contextType = params.contextType ?? 'SITE';\n\n this.createComponentSettings =\n params.createComponentSettings ?? createComponentSettings;\n\n this.errorMonitor = params.errorMonitor;\n this.errorHandler = params.errorHandler ?? {\n withErrorHandler: (fn) => fn(),\n getResolvedError: <T>() => {\n const { translate: t } = this;\n\n return {\n message: t('cairo.technical.error.text'),\n } as errorHandler.ResolvedError & Partial<T>;\n },\n showError: () => {\n const { translate: t } = this;\n\n this.showToast?.({\n message: t('cairo.technical.error.text'),\n type: 'ERROR',\n });\n },\n };\n this.httpClient = params.httpClient;\n this.onlineManager = params.onlineManager;\n this.focusManager = params.focusManager;\n this.history = params.history;\n this.useTranslation = params.useTranslation;\n this.useExperiments = createUseExperimentsCompat(params.useExperiments);\n this.experiments = params.experiments;\n this.showToast = params.showToast;\n this.usePageLocation = params.usePageLocation;\n this.navigateTo = params.navigateTo;\n this.onNavigation = params.onNavigation;\n this.getHostContainer = params.getHostContainer;\n this.window = params.window;\n this.queryCache = params.queryCache;\n this.appendModalsToBody = params.appendModalsToBody;\n this.layoutType = params.layoutType;\n this._useRelativeSidePanel = params.useRelativeSidePanel;\n this.onSidePanelOpen = params.onSidePanelOpen;\n this.closeSidePanel = params.closeSidePanel;\n this.onBeforeUnload = params.onBeforeUnload;\n this.onLayerStateChange = params.onLayerStateChange;\n this.openMediaManager = params.openMediaManager;\n\n const {\n i18n,\n biLoggerFactory,\n fedopsLogger: internalFedops,\n errorMonitor: internalErrorMonitor,\n experiments: internalExperiments,\n } = this.createEssentials({\n i18n: {\n useSuspense: false,\n disableAutoInit: true,\n asyncMessagesLoader: async (locale) => {\n if (locale === 'en') {\n return this._messagesEnImport();\n }\n return this._fetchTranslations(this)(locale);\n },\n messages: params.initialProps?.messages,\n },\n errorMonitor: {\n dsn:\n process.env.NODE_ENV === 'production'\n ? 'https://9b9586a905eb429cbda9ea49d5d721f6@sentry-next.wixpress.com/8780'\n : '',\n /*\n TODO: not used in sentry-next API, need to be merged from reportError API with tags & extraData\n For Example: errorMonitor.captureException(error, { tags, contexts: { runtime: extraData }})\n beforeSend: (event, hint) => {\n this.internalMonitor.reportErrorThrownOncePerFlow();\n\n if (!event.tags) {\n event.tags = {};\n }\n\n if (!event.extra) {\n event.extra = {};\n }\n\n if (hint && hint.originalException) {\n event.extra.exception = hint.originalException;\n\n if (hint.originalException instanceof Error) {\n event.fingerprint = [\n `${hint.originalException.name}:${hint.originalException.message}`,\n ];\n }\n }\n\n event.tags.componentName = this.environment.componentName;\n event.tags.componentId = this.environment.componentId;\n event.tags.artifactId = this.environment.artifactId;\n event.tags.cairoVersion = this.environment.uiLibVersion;\n\n return event;\n },\n */\n },\n fedops: {\n appName: 'cairo',\n },\n experiments: {\n scopes: ['cairo'],\n },\n });\n\n if (\n typeof process !== 'undefined' &&\n process.env.STORYBOOK_VISUAL_E2E === 'true'\n ) {\n i18n.options.fallbackLng = [];\n }\n\n this.cairoSessionId = uuid();\n this.biLogger = params.biLogger ?? biLoggerFactory?.().logger();\n this.i18n = i18n;\n this.internalMonitor = new WixPatternsMonitor({\n errorMonitor: params.errorMonitor,\n internalErrorMonitor,\n internalFedops,\n environment: this.environment,\n csid: this.cairoSessionId,\n });\n this.internalExperiments = internalExperiments;\n\n this.enableTranslatedKeySuffix =\n this.experiments.enabled('specs.cairo.example-bm.tagsToLabels') ||\n this.experiments.enabled('specs.cairo.contacts.tagsToLabels');\n\n this.translate = (key, params) => {\n void this.initTask.status; // status is observable so reading it here starts mobx reactivity\n if (this.enableTranslatedKeySuffix) {\n return this.i18n.t(`${key}.asLabels`, {\n ...params,\n defaultValue: this.i18n.t(key, params),\n });\n }\n return this.i18n.t(key, params);\n };\n\n this.Trans = params.Trans;\n\n this.onlineState = new OnlineState({\n onlineManager: this.onlineManager,\n focusManager: this.focusManager,\n translate: this.translate,\n showToast: this.showToast,\n });\n\n this.reportBi = this.createBILogger({});\n\n makeObservable(this, {\n init: action.bound,\n initialFetch: action.bound,\n dateFormatters: computed,\n isPanelLayout: computed,\n _isMobile: observable.ref,\n });\n\n this._isMobile = isMobileDevice();\n }\n setIsAutoPatterns(value: boolean) {\n this._isAutoPatterns = value;\n }\n\n _createComponentSettings(options: { namespace: string }) {\n return this.createComponentSettings(this)(options);\n }\n\n createBILogger = <P>(defaultParams: P): ReportBI => {\n return (reportProps: ReportProps) => {\n const { environment, environmentBI, cairoSessionId, biLogger, user } =\n this;\n\n const {\n params: { url, ...rest },\n } = reportProps;\n\n return biLogger?.report({\n ...reportProps,\n params: {\n ...(environment.msid && { msid: environment.msid }),\n ...(user.id && { uuid: user.id }),\n artifactId: environment.artifactId,\n artifactIdNew: environmentBI.artifactId,\n componentName: environment.componentName,\n componentIdNew: environmentBI.componentId,\n cairoVersion: environment.uiLibVersion,\n csid: cairoSessionId,\n ...(environment.providerType === 'bm' && {\n _hostingPlatform: 'business-manager',\n }),\n isAutoPatterns: this._isAutoPatterns,\n ...defaultParams,\n ...(url && { url: fixDomainForBI(url) }),\n ...rest,\n },\n });\n };\n };\n\n async initialFetch() {\n const { initTask, i18n, internalExperiments, experiments } = this;\n\n initTask.runOnce(async () => {\n await Promise.all([\n i18n.init(),\n internalExperiments?.ready().catch((e) => {\n console.error(e);\n }),\n experiments.ready().catch((e: unknown) => {\n console.error(e);\n }),\n this._messagesEnImport(), // not all translation files contain all the keys, so en is required otherwise show error state\n ]);\n });\n\n return initTask.status.promise;\n }\n\n get dateFormatters() {\n return {\n medium: new Intl.DateTimeFormat(this.environment.language, {\n dateStyle: 'medium',\n }),\n mediumTime: new Intl.DateTimeFormat(this.environment.language, {\n dateStyle: 'medium',\n timeStyle: 'short',\n }),\n time: new Intl.DateTimeFormat(this.environment.language, {\n timeStyle: 'short',\n }),\n };\n }\n\n get isPanelLayout() {\n return this.layoutType === 'panel';\n }\n\n get isMobile() {\n return this._isMobile;\n }\n\n get useRelativeSidePanel() {\n return (\n this._useRelativeSidePanel ||\n this.internalExperiments?.enabled('specs.cairo.useRelativeSidePanel')\n );\n }\n\n init() {\n const { onlineState } = this;\n\n this.initialFetch().catch((e) => {\n console.error(e);\n });\n\n const disposers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CAACxI,WAAW,CAACyI,QAAQ,EAAE;QAC7DC,SAAS,EAAE,QAAQ;QACnBE,SAAS,EAAE;MACb,CAAC,CAAC;MACFC,IAAI,EAAE,IAAIN,IAAI,CAACC,cAAc,CAAC,IAAI,CAACxI,WAAW,CAACyI,QAAQ,EAAE;QACvDG,SAAS,EAAE;MACb,CAAC;IACH,CAAC;EACH;EAEA,IAAItB,aAAaA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACnD,UAAU,KAAK,OAAO;EACpC;EAEA,IAAI2E,QAAQA,CAAA,EAAG;IACb,OAAO,IAAI,CAACvB,SAAS;EACvB;EAEA,IAAIlD,oBAAoBA,CAAA,EAAG;IAAA,IAAA0E,qBAAA;IACzB,OACE,IAAI,CAAC3E,qBAAqB,MAAA2E,qBAAA,GAC1B,IAAI,CAAC/D,mBAAmB,qBAAxB+D,qBAAA,CAA0B1C,OAAO,CAAC,kCAAkC,CAAC;EAEzE;EAEAW,IAAIA,CAAA,EAAG;IACL,MAAM;MAAEL;IAAY,CAAC,GAAG,IAAI;IAE5B,IAAI,CAACQ,YAAY,CAAC,CAAC,CAACc,KAAK,CAAEC,CAAC,IAAK;MAC/BC,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,MAAMc,SAAS,GAAG,CAChBrC,WAAW,CAACK,IAAI,CAAC,CAAC,EAClB,IAAIiC,gDAAuB,CAAC,IAAI,CAAC,CAACjC,IAAI,CAAC,CAAC,CACzC;IAED,OAAO,MAAM;MACXgC,SAAS,CAACE,OAAO,CAAEC,CAAC,IAAKA,CAAC,oBAADA,CAAC,CAAG,CAAC,CAAC;IACjC,CAAC;EACH;AACF;AAACC,OAAA,CAAA7J,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_services","require","_model","_mobx","_TaskState","_OnlineState","_createComponentSettings","_ConditionalModalState","_events","_util","_useExperimentsCompat","_uuid","_BeforeUnloadCompatState","WixPatternsContainer","constructor","params","_params$initialProps","_defineProperty2","default","TaskState","defaultParams","reportProps","environment","environmentBI","cairoSessionId","biLogger","user","url","rest","report","msid","id","uuid","artifactId","artifactIdNew","componentName","componentIdNew","componentId","cairoVersion","uiLibVersion","csid","providerType","_hostingPlatform","isAutoPatterns","_isAutoPatterns","fixDomainForBI","createEssentials","lodash","patchesCache","events","EventEmitter","_messagesEnImport","messagesEnImport","messagesEnImportGlobal","_fetchTranslations","fetchTranslations","onNavigationModal","ConditionalModalState","wixPatternsEnvironment","contextType","createComponentSettings","errorMonitor","errorHandler","withErrorHandler","fn","getResolvedError","translate","t","message","showError","_this$showToast","showToast","call","type","httpClient","onlineManager","focusManager","history","useTranslation","useExperiments","createUseExperimentsCompat","experiments","usePageLocation","navigateTo","onNavigation","getHostContainer","window","queryCache","appendModalsToBody","layoutType","_useRelativeSidePanel","useRelativeSidePanel","onSidePanelOpen","closeSidePanel","onBeforeUnload","onLayerStateChange","openMediaManager","i18n","biLoggerFactory","fedopsLogger","internalFedops","internalErrorMonitor","internalExperiments","useSuspense","disableAutoInit","asyncMessagesLoader","locale","messages","initialProps","dsn","process","env","NODE_ENV","fedops","appName","scopes","STORYBOOK_VISUAL_E2E","options","fallbackLng","logger","internalMonitor","WixPatternsMonitor","enableTranslatedKeySuffix","enabled","key","initTask","status","defaultValue","Trans","onlineState","OnlineState","reportBi","createBILogger","makeObservable","init","action","bound","initialFetch","dateFormatters","computed","isPanelLayout","_isMobile","observable","ref","isMobileDevice","setIsAutoPatterns","value","runOnce","Promise","all","ready","catch","e","console","error","promise","medium","Intl","DateTimeFormat","language","dateStyle","mediumTime","timeStyle","time","isMobile","_this$internalExperim","disposers","BeforeUnloadCompatState","forEach","d","exports"],"sources":["../../../src/state/WixPatternsContainer.ts"],"sourcesContent":["import type { Essentials } from '@wix/fe-essentials/core';\nimport type { Trans, useTranslation } from '@wix/fe-essentials/react';\nimport type { ReportProps } from '@wix/fe-essentials/bi';\nimport {\n Environment,\n EnvironmentBi,\n ErrorMonitor,\n fetchTranslations,\n FocusManager,\n History,\n messagesEnImportGlobal,\n ModalLayoutProps,\n OnlineManager,\n PartialLodash,\n PartialWindow,\n ReportBI,\n Translate,\n WixPatternsMonitor,\n} from '../services';\nimport { QueryCache } from 'react-query/core';\nimport {\n CloseSidePanel,\n ContextType,\n GetHostContainer,\n OnNavigation,\n OnSidePanelOpen,\n PatternsErrorHandler,\n ShowToast,\n wixPatternsEnvironment,\n WixPatternsEssentials,\n WixPatternsInitialProps,\n} from '../model';\nimport {\n action,\n computed,\n IObservableArray,\n makeObservable,\n observable,\n} from 'mobx';\nimport { TaskState } from './TaskState';\nimport { OnlineState } from './OnlineState';\nimport { createComponentSettings } from '../services/createComponentSettings';\nimport { OptimisticPatch } from './CollectionOptimisticPatch';\nimport { ConditionalModalState } from './ConditionalModalState';\nimport { EventEmitter } from 'events';\nimport { fixDomainForBI, isMobileDevice, TypedEmitter } from '../util';\nimport { TransitionState } from './TransitionState';\nimport { ReactElement } from 'react';\nimport { createUseExperimentsCompat } from './useExperimentsCompat';\nimport { v4 as uuid } from 'uuid';\nimport { BeforeUnloadCompatState } from './BeforeUnloadCompatState';\nimport type { errorHandler } from '@wix/essentials';\nimport { PatternsLayoutType } from '../model/PatternsLayoutType';\n\ntype WixPatternsContainerEvents = TypedEmitter<{\n navigation: () => ModalLayoutProps | null | undefined;\n}>;\n\nexport interface WixPatternsContainerParams {\n readonly initialProps?: WixPatternsInitialProps;\n readonly createEssentials: WixPatternsEssentials['createEssentials'];\n readonly biLogger?: WixPatternsEssentials['biLogger'];\n readonly messagesEnImport?: () => Promise<{}>;\n readonly fetchTranslations?: (p: {\n readonly errorMonitor: ErrorMonitor;\n }) => (locale: string) => Promise<{}>;\n readonly createComponentSettings?: WixPatternsEssentials['createComponentSettings'];\n readonly errorMonitor: ErrorMonitor;\n readonly httpClient: WixPatternsEssentials['httpClient'];\n readonly onlineManager: OnlineManager;\n readonly focusManager: FocusManager;\n readonly contextType?: ContextType;\n readonly history: History;\n readonly window: PartialWindow;\n readonly useTranslation: typeof useTranslation;\n readonly Trans: typeof Trans;\n readonly useExperiments: WixPatternsEssentials['useExperiments'];\n readonly experiments: WixPatternsEssentials['experiments'];\n readonly environment: WixPatternsEssentials['environment'];\n readonly environmentBI: WixPatternsEssentials['environmentBI'];\n readonly errorHandler?: WixPatternsEssentials['errorHandler'];\n readonly user: WixPatternsEssentials['user'];\n readonly showToast?: ShowToast;\n readonly usePageLocation?: WixPatternsEssentials['usePageLocation'];\n readonly navigateTo?: WixPatternsEssentials['navigateTo'];\n readonly onNavigation?: OnNavigation;\n readonly getHostContainer?: GetHostContainer;\n readonly queryCache: QueryCache;\n readonly patchesCache: Map<string, IObservableArray<OptimisticPatch<any>>>;\n readonly onSidePanelOpen?: OnSidePanelOpen;\n readonly closeSidePanel?: CloseSidePanel;\n readonly lodash: PartialLodash;\n readonly events?: WixPatternsContainerEvents;\n readonly sidePanel?: TransitionState<string>;\n readonly onNavigationModal?: ConditionalModalState<ModalLayoutProps>;\n readonly sidePanelComponents?: Map<string, ReactElement>;\n readonly appendModalsToBody?: boolean;\n readonly layoutType?: PatternsLayoutType;\n readonly useRelativeSidePanel?: boolean;\n readonly onBeforeUnload?: WixPatternsEssentials['onBeforeUnload'];\n readonly onLayerStateChange?: WixPatternsEssentials['onLayerStateChange'];\n readonly openMediaManager?: WixPatternsEssentials['openMediaManager'];\n}\n\nexport class WixPatternsContainer {\n readonly createEssentials;\n readonly errorMonitor: WixPatternsContainerParams['errorMonitor'];\n readonly errorHandler: PatternsErrorHandler;\n readonly internalMonitor: WixPatternsMonitor;\n readonly internalExperiments;\n readonly experiments: WixPatternsContainerParams['experiments'];\n readonly httpClient: WixPatternsContainerParams['httpClient'];\n readonly onlineManager;\n readonly focusManager;\n readonly contextType: ContextType;\n readonly history: WixPatternsContainerParams['history'];\n readonly window: WixPatternsContainerParams['window'];\n readonly useTranslation;\n readonly Trans: typeof Trans;\n readonly useExperiments;\n readonly showToast?;\n readonly usePageLocation?;\n readonly navigateTo?;\n readonly onNavigation;\n readonly onBeforeUnload;\n readonly onLayerStateChange?: WixPatternsEssentials['onLayerStateChange'];\n readonly openMediaManager?: WixPatternsEssentials['openMediaManager'];\n readonly getHostContainer;\n readonly environment: Environment;\n readonly environmentBI: EnvironmentBi;\n readonly appendModalsToBody?: boolean;\n readonly layoutType?: string;\n readonly _useRelativeSidePanel?: boolean;\n\n readonly onSidePanelOpen?: OnSidePanelOpen;\n readonly closeSidePanel?: CloseSidePanel;\n readonly translate: Translate;\n readonly lodash;\n readonly i18n: Essentials['i18n'];\n readonly reportBi: ReportBI;\n readonly _messagesEnImport;\n readonly _fetchTranslations;\n\n queryCache: QueryCache;\n readonly patchesCache;\n\n readonly initTask = new TaskState<void>();\n readonly onlineState: OnlineState;\n\n readonly onNavigationModal;\n\n readonly events: TypedEmitter<{\n navigation: () => ModalLayoutProps | null | undefined;\n }>;\n\n readonly user;\n\n readonly cairoSessionId: string;\n\n readonly biLogger;\n\n readonly createComponentSettings;\n\n readonly enableTranslatedKeySuffix: boolean;\n\n private _isAutoPatterns: boolean = false;\n\n // CAIRO-3582: modify mobile detection to use user agent\n _isMobile = false;\n\n constructor(params: Readonly<WixPatternsContainerParams>) {\n this.createEssentials = params.createEssentials;\n this.lodash = params.lodash;\n this.patchesCache = params.patchesCache;\n this.events =\n params.events ?? (new EventEmitter() as WixPatternsContainerEvents);\n this._messagesEnImport = params.messagesEnImport ?? messagesEnImportGlobal;\n this._fetchTranslations = params.fetchTranslations ?? fetchTranslations;\n\n this.onNavigationModal =\n params.onNavigationModal ?? new ConditionalModalState();\n\n this.environment = wixPatternsEnvironment(params.environment);\n this.environmentBI = params.environmentBI;\n this.user = params.user;\n this.contextType = params.contextType ?? 'SITE';\n\n this.createComponentSettings =\n params.createComponentSettings ?? createComponentSettings;\n\n this.errorMonitor = params.errorMonitor;\n this.errorHandler = params.errorHandler ?? {\n withErrorHandler: (fn) => fn(),\n getResolvedError: <T>() => {\n const { translate: t } = this;\n\n return {\n message: t('cairo.technical.error.text'),\n } as errorHandler.ResolvedError & Partial<T>;\n },\n showError: () => {\n const { translate: t } = this;\n\n this.showToast?.({\n message: t('cairo.technical.error.text'),\n type: 'ERROR',\n });\n },\n };\n this.httpClient = params.httpClient;\n this.onlineManager = params.onlineManager;\n this.focusManager = params.focusManager;\n this.history = params.history;\n this.useTranslation = params.useTranslation;\n this.useExperiments = createUseExperimentsCompat(params.useExperiments);\n this.experiments = params.experiments;\n this.showToast = params.showToast;\n this.usePageLocation = params.usePageLocation;\n this.navigateTo = params.navigateTo;\n this.onNavigation = params.onNavigation;\n this.getHostContainer = params.getHostContainer;\n this.window = params.window;\n this.queryCache = params.queryCache;\n this.appendModalsToBody = params.appendModalsToBody;\n this.layoutType = params.layoutType;\n this._useRelativeSidePanel = params.useRelativeSidePanel;\n this.onSidePanelOpen = params.onSidePanelOpen;\n this.closeSidePanel = params.closeSidePanel;\n this.onBeforeUnload = params.onBeforeUnload;\n this.onLayerStateChange = params.onLayerStateChange;\n this.openMediaManager = params.openMediaManager;\n\n const {\n i18n,\n biLoggerFactory,\n fedopsLogger: internalFedops,\n errorMonitor: internalErrorMonitor,\n experiments: internalExperiments,\n } = this.createEssentials({\n i18n: {\n useSuspense: false,\n disableAutoInit: true,\n asyncMessagesLoader: async (locale) => {\n if (locale === 'en') {\n return this._messagesEnImport();\n }\n return this._fetchTranslations(this)(locale);\n },\n messages: params.initialProps?.messages,\n },\n errorMonitor: {\n dsn:\n process.env.NODE_ENV === 'production'\n ? 'https://9b9586a905eb429cbda9ea49d5d721f6@sentry-next.wixpress.com/8780'\n : '',\n /*\n TODO: not used in sentry-next API, need to be merged from reportError API with tags & extraData\n For Example: errorMonitor.captureException(error, { tags, contexts: { runtime: extraData }})\n beforeSend: (event, hint) => {\n this.internalMonitor.reportErrorThrownOncePerFlow();\n\n if (!event.tags) {\n event.tags = {};\n }\n\n if (!event.extra) {\n event.extra = {};\n }\n\n if (hint && hint.originalException) {\n event.extra.exception = hint.originalException;\n\n if (hint.originalException instanceof Error) {\n event.fingerprint = [\n `${hint.originalException.name}:${hint.originalException.message}`,\n ];\n }\n }\n\n event.tags.componentName = this.environment.componentName;\n event.tags.componentId = this.environment.componentId;\n event.tags.artifactId = this.environment.artifactId;\n event.tags.cairoVersion = this.environment.uiLibVersion;\n\n return event;\n },\n */\n },\n fedops: {\n appName: 'cairo',\n },\n experiments: {\n scopes: ['cairo'],\n },\n });\n\n if (\n typeof process !== 'undefined' &&\n process.env.STORYBOOK_VISUAL_E2E === 'true'\n ) {\n i18n.options.fallbackLng = [];\n }\n\n this.cairoSessionId = uuid();\n this.biLogger = params.biLogger ?? biLoggerFactory?.().logger();\n this.i18n = i18n;\n this.internalMonitor = new WixPatternsMonitor({\n errorMonitor: params.errorMonitor,\n internalErrorMonitor,\n internalFedops,\n environment: this.environment,\n csid: this.cairoSessionId,\n });\n this.internalExperiments = internalExperiments;\n\n this.enableTranslatedKeySuffix =\n this.experiments.enabled('specs.cairo.example-bm.tagsToLabels') ||\n this.experiments.enabled('specs.cairo.contacts.tagsToLabels');\n\n this.translate = (key, params) => {\n void this.initTask.status; // status is observable so reading it here starts mobx reactivity\n if (this.enableTranslatedKeySuffix) {\n return this.i18n.t(`${key}.asLabels`, {\n ...params,\n defaultValue: this.i18n.t(key, params),\n });\n }\n return this.i18n.t(key, params);\n };\n\n this.Trans = params.Trans;\n\n this.onlineState = new OnlineState({\n onlineManager: this.onlineManager,\n focusManager: this.focusManager,\n translate: this.translate,\n showToast: this.showToast,\n });\n\n this.reportBi = this.createBILogger({});\n\n makeObservable(this, {\n init: action.bound,\n initialFetch: action.bound,\n dateFormatters: computed,\n isPanelLayout: computed,\n _isMobile: observable.ref,\n });\n\n this._isMobile = isMobileDevice();\n }\n setIsAutoPatterns(value: boolean) {\n this._isAutoPatterns = value;\n }\n\n _createComponentSettings(options: { namespace: string }) {\n return this.createComponentSettings(this)(options);\n }\n\n createBILogger = <P>(defaultParams: P): ReportBI => {\n return (reportProps: ReportProps) => {\n const { environment, environmentBI, cairoSessionId, biLogger, user } =\n this;\n\n const {\n params: { url, ...rest },\n } = reportProps;\n\n return biLogger?.report({\n ...reportProps,\n params: {\n ...(environment.msid && { msid: environment.msid }),\n ...(user.id && { uuid: user.id }),\n artifactId: environment.artifactId,\n artifactIdNew: environmentBI.artifactId,\n componentName: environment.componentName,\n componentIdNew: environmentBI.componentId,\n cairoVersion: environment.uiLibVersion,\n csid: cairoSessionId,\n ...(environment.providerType === 'bm' && {\n _hostingPlatform: 'business-manager',\n }),\n isAutoPatterns: this._isAutoPatterns,\n ...defaultParams,\n ...(url && { url: fixDomainForBI(url) }),\n ...rest,\n },\n });\n };\n };\n\n async initialFetch() {\n const { initTask, i18n, internalExperiments, experiments } = this;\n\n initTask.runOnce(async () => {\n await Promise.all([\n i18n.init(),\n internalExperiments?.ready().catch((e) => {\n console.error(e);\n }),\n experiments.ready().catch((e: unknown) => {\n console.error(e);\n }),\n this._messagesEnImport(), // not all translation files contain all the keys, so en is required otherwise show error state\n ]);\n });\n\n return initTask.status.promise;\n }\n\n get dateFormatters() {\n return {\n medium: new Intl.DateTimeFormat(this.environment.language, {\n dateStyle: 'medium',\n }),\n mediumTime: new Intl.DateTimeFormat(this.environment.language, {\n dateStyle: 'medium',\n timeStyle: 'short',\n }),\n time: new Intl.DateTimeFormat(this.environment.language, {\n timeStyle: 'short',\n }),\n };\n }\n\n get isPanelLayout() {\n return this.layoutType === 'panel';\n }\n\n get isMobile() {\n return this._isMobile;\n }\n\n get useRelativeSidePanel() {\n return (\n this._useRelativeSidePanel ||\n (this.internalExperiments?.enabled('useRelativeSidePanel') &&\n this.experiments.enabled('bmHarmonyTheme'))\n );\n }\n\n init() {\n const { onlineState } = this;\n\n this.initialFetch().catch((e) => {\n console.error(e);\n });\n\n const disposers = [\n onlineState.init(),\n new BeforeUnloadCompatState(this).init(),\n ];\n\n return () => {\n disposers.forEach((d) => d?.());\n };\n }\n}\n"],"mappings":";;;;;;AAGA,IAAA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,IAAIN,IAAI,CAACC,cAAc,CAAC,IAAI,CAACxI,WAAW,CAACyI,QAAQ,EAAE;QACvDG,SAAS,EAAE;MACb,CAAC;IACH,CAAC;EACH;EAEA,IAAItB,aAAaA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACnD,UAAU,KAAK,OAAO;EACpC;EAEA,IAAI2E,QAAQA,CAAA,EAAG;IACb,OAAO,IAAI,CAACvB,SAAS;EACvB;EAEA,IAAIlD,oBAAoBA,CAAA,EAAG;IAAA,IAAA0E,qBAAA;IACzB,OACE,IAAI,CAAC3E,qBAAqB,IACzB,EAAA2E,qBAAA,OAAI,CAAC/D,mBAAmB,qBAAxB+D,qBAAA,CAA0B1C,OAAO,CAAC,sBAAsB,CAAC,KACxD,IAAI,CAAC1C,WAAW,CAAC0C,OAAO,CAAC,gBAAgB,CAAE;EAEjD;EAEAW,IAAIA,CAAA,EAAG;IACL,MAAM;MAAEL;IAAY,CAAC,GAAG,IAAI;IAE5B,IAAI,CAACQ,YAAY,CAAC,CAAC,CAACc,KAAK,CAAEC,CAAC,IAAK;MAC/BC,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,MAAMc,SAAS,GAAG,CAChBrC,WAAW,CAACK,IAAI,CAAC,CAAC,EAClB,IAAIiC,gDAAuB,CAAC,IAAI,CAAC,CAACjC,IAAI,CAAC,CAAC,CACzC;IAED,OAAO,MAAM;MACXgC,SAAS,CAACE,OAAO,CAAEC,CAAC,IAAKA,CAAC,oBAADA,CAAC,CAAG,CAAC,CAAC;IACjC,CAAC;EACH;AACF;AAACC,OAAA,CAAA7J,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -50,6 +50,19 @@ function isFilterTypeConfig(filter) {
|
|
|
50
50
|
* Members use method syntax so a definition typed with a concrete value type
|
|
51
51
|
* stays assignable where a loosely typed definition is expected. */
|
|
52
52
|
|
|
53
|
+
/** The field-modal slot of a field type definition: opts the type into the
|
|
54
|
+
* add/edit-field modal's type picker and describes its entry there. */
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Props the entity-page form dispatcher passes to a field type's form
|
|
58
|
+
* component. The dispatcher owns the form wiring (registration, validation
|
|
59
|
+
* from the definition's `value.validate`) and the field UI (label, required
|
|
60
|
+
* marker, error message) — the component renders only the input: read
|
|
61
|
+
* `value`, report edits through `onChange`.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/** The entity-page form slot of a field type definition. */
|
|
65
|
+
|
|
53
66
|
/**
|
|
54
67
|
* A consumer-defined field type. Defined once on the fields source; every
|
|
55
68
|
* entry point that renders the field resolves its slot from here. `V` is the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isFilterTypeConfig","filter","defineFieldType","definition","resolveFieldTypeDefinition","source","field","_source$fieldTypes","type","customType","undefined","fieldTypes","find","def"],"sources":["../../../src/types/FieldTypeDefinition.ts"],"sourcesContent":["import type {\n ComponentType,\n MutableRefObject,\n ReactElement,\n ReactNode,\n} from 'react';\nimport type { Field } from './Field';\nimport type { Filter } from '../model/filter';\nimport type { FieldsSource } from './FieldsSource';\n\nexport type ValidationRule =\n | { type: 'required'; message: string }\n | { type: 'min' | 'max'; value: number; message: string }\n | { type: 'minLength' | 'maxLength'; value: number; message: string }\n | { type: 'pattern'; value: RegExp; message: string }\n | { type: 'custom'; validate: (value: unknown) => boolean; message: string }\n | {\n type: 'specificValues';\n values: { id: string; value: string }[];\n message: string;\n };\n\nexport interface Focusable {\n focus: () => void;\n}\n\nexport type EditTrigger =\n | { kind: 'type'; key: string }\n | 'enter'\n | 'click'\n | 'doubleClick';\n\nexport interface CellViewProps<V> {\n value: V;\n typeConfig?: unknown;\n validation?: ValidationRule[];\n /** Stable id of the column. Cell components can use it to derive unique DOM ids. */\n columnId: string;\n /** Stable key of the row. Cell components can use it to derive unique DOM ids. */\n rowKey: string;\n}\n\nexport interface CellEditProps<V> {\n value: V;\n // Method syntax keeps CellEditProps covariant in V (see FieldTypeDefinition).\n onChange(value: V): void;\n onCommit: () => void;\n onCancel: () => void;\n /**\n * Signals that the cell is starting an editing operation that will move focus\n * outside the table (e.g., opening a media manager or a modal). Calling this\n * sets isEditing=true so the table does not clear cell focus while the\n * external UI is open. Pair with onCommit (after the operation succeeds)\n * or onCancel (if the user dismisses without a value change).\n */\n onStartEdit?: () => void;\n /** Ref to the focusable input element. Used for type-to-edit (focusing the input when user starts typing on a focused cell). */\n inputRef?: MutableRefObject<Focusable | undefined | null>;\n typeConfig?: unknown;\n /** How edit mode was triggered. Edit components can use this to customize behavior (e.g., date picker auto-opens on 'type'). */\n editTrigger?: EditTrigger | null;\n /** Column-level validation rules. Edit components can derive UI behavior (e.g., maxLength blocking/tooltip) from these. */\n validation?: ValidationRule[];\n /** Stable id of the column. Cell components can use it to derive unique DOM ids. */\n columnId: string;\n /** Stable key of the row. Cell components can use it to derive unique DOM ids. */\n rowKey: string;\n}\n\n/**\n * Props passed to a cell type's optional `EditWrapper`. The table mounts the\n * wrapper around the cell content and keeps it mounted across the edit↔view\n * transition, so the wrapper can own behavior that must outlive the inline\n * editor (e.g. a reference cell navigating to an overlay and refreshing on\n * return). The wrapper hands anything the editor needs down via its own context.\n */\nexport interface CellEditWrapperProps {\n /** The column's typeConfig (same value handed to the cell's Edit/View). */\n typeConfig?: unknown;\n /** Stable id of the column. */\n columnId: string;\n /** Stable key of the row. */\n rowKey: string;\n /** The cell content (the Edit or View component) to render inside the wrapper. */\n children: ReactNode;\n}\n\n/**\n * The editable-cell slot of a field type definition: how a cell of that type\n * renders, edits, and moves through the clipboard. The definition's key\n * identifies the type and the definition's `value` owns validation, so the\n * slot carries neither.\n *\n * Members that take `V` use method syntax so a definition typed with a\n * concrete value type stays assignable where a loosely typed definition is\n * expected (see `FieldTypeDefinition`).\n */\nexport interface EditableCellConfig<V> {\n /** Render cell in view mode (read-only display). */\n ViewComponent(props: CellViewProps<V>): ReactElement | null;\n /** Render cell in edit mode (inline editor). Optional — omit for view-only cells. */\n EditComponent?(props: CellEditProps<V>): ReactElement | null;\n /** Serialize value to clipboard string. */\n serialize?(value: V): string;\n /** Deserialize clipboard string to value. */\n deserialize?(raw: string): V;\n /** Can this cell type be edited? (default: true) */\n editable?: boolean;\n /** Can this cell type be cleared with Delete key? (default: true) */\n clearable?: boolean;\n /** Toggle value on single click (e.g., boolean checkbox). Skips focus→edit flow. */\n toggleValue?(value: V): V;\n /** Enter edit mode on single click (e.g., image cell with no value). */\n editOnClick?(value: V): boolean;\n /** Show the EditComponent when the cell is focused, without entering edit mode.\n * Keyboard navigation remains active. Similar to toggleValue but without toggling. */\n showEditWhenFocused?: boolean;\n /** Optional wrapper component the cell type defines to own behavior that must\n * outlive the inline editor. Mounted around the cell content and kept mounted\n * across the edit↔view transition. */\n EditWrapper?: ComponentType<CellEditWrapperProps>;\n /** Cell content can grow past row height when focused. Only applies to\n * showEditWhenFocused cells. */\n growable?: boolean;\n /** Called on type-to-edit. Return object with cleared value and/or prevent flag.\n * Return undefined to block the key. Return {} to enter edit mode without changing the value. */\n onTypeToEdit?(params: {\n key: string;\n validation?: ValidationRule[];\n }): { value?: V } | undefined;\n /** Optional hook to normalize the committed value (e.g. auto-prepend https://).\n * Called before the edit commits; the value is written back before committing. */\n normalizeOnCommit?(value: V): V;\n /** When true, type-to-edit flushes the edit-mode render synchronously and\n * focuses the input within the same keydown event, then lets the browser's\n * default action deliver the keystroke to the now-focused input naturally.\n * Use for cells that wrap a controlled input whose value can't be seeded via props. */\n nativeTypeToEdit?: boolean;\n}\n\n/** The props the filter builder passes to a definition's toolbar filter\n * component — the same contract the built-in filter elements receive. */\nexport interface FilterTypeComponentProps<V = any> {\n filter: Filter<V>;\n toolbarItemProps?: { label?: ReactNode };\n toolbarTagProps?: { label?: string };\n accordionItemProps?: { label?: string };\n}\n\n/** The filter slot of a field type definition: the filter state registered on\n * the collection query and the toolbar element that renders it. */\nexport interface FilterTypeConfig {\n createFilter: (field: Field) => Filter<any>;\n Component: ComponentType<FilterTypeComponentProps>;\n}\n\n/** Narrows a definition's filter slot to an active filter config. */\nexport function isFilterTypeConfig(\n filter: FieldTypeDefinition['filter'],\n): filter is FilterTypeConfig {\n return 'createFilter' in filter;\n}\n\n/**\n * The read-only table slot of a field type definition: how a cell of that\n * type renders in the table, and the column's layout. Independent of\n * `editableTable` — neither slot falls back to the other.\n */\nexport interface TableCellConfig<V> {\n /** Render the cell. Method syntax keeps the definition assignable to\n * `FieldTypeDefinition<unknown>` (see FieldTypeDefinition). */\n CellComponent(props: { value: V }): ReactElement | null;\n /** Column width. Required — custom types get no built-in layout default. */\n width: string;\n /** Default: 'start'. */\n align?: 'start' | 'center' | 'end';\n}\n\n/** An extra menu item a field type definition adds to a field's actions menu. */\nexport interface FieldTypeActionItem {\n key: string;\n label: string;\n icon?: ReactNode;\n skin?: 'destructive';\n onClick: (field: Field) => void;\n /** Default: visible. */\n visible?: (field: Field) => boolean;\n /** Returning a string disables the item and shows the tooltip. */\n disabledTooltip?: (field: Field) => string | undefined;\n}\n\n/** The actions slot of a field type definition: extra items for the field's \"more actions\" menu. */\nexport interface FieldActionsConfig {\n items?: FieldTypeActionItem[];\n}\n\n/** Display metadata for a field type: menu label and type icons. */\nexport interface FieldTypeDisplay {\n label: string;\n icons: {\n Small: ComponentType;\n Medium: ComponentType;\n };\n}\n\n/** Value semantics of a field type, independent of any rendering surface.\n * Members use method syntax so a definition typed with a concrete value type\n * stays assignable where a loosely typed definition is expected. */\nexport interface FieldValueBehavior<V> {\n defaultValue?: V;\n isEmpty?(value: V): boolean;\n /** Returns an error message, or null when the value is valid. Every surface\n * that validates a field of this type runs this. */\n validate?(value: V, rules?: ValidationRule[]): string | null;\n}\n\nexport interface FieldCapabilities {\n sortable: boolean;\n}\n\n/**\n * A consumer-defined field type. Defined once on the fields source; every\n * entry point that renders the field resolves its slot from here. `V` is the\n * field's value type — `defineFieldType` infers it, and it keeps all the\n * slots consistent with each other.\n *\n * Sources hold definitions of mixed value types in one\n * `FieldTypeDefinition[]` (= `FieldTypeDefinition<unknown>[]`) array. That\n * works because every member that takes `V` is declared with method syntax,\n * which TypeScript checks bivariantly — so `FieldTypeDefinition<number>` is\n * assignable to `FieldTypeDefinition<unknown>` without casts.\n */\nexport interface FieldTypeDefinition<V = unknown> {\n /** Unique key for the type. A built-in type uses its `PatternsFieldType`; a\n * consumer-defined type uses the string its fields reference via `customType`. */\n type: string;\n display: FieldTypeDisplay;\n /** Filter behavior, or an explicit opt-out — never silently absent. */\n filter: FilterTypeConfig | { filterable: false };\n value?: FieldValueBehavior<V>;\n capabilities?: FieldCapabilities;\n /** Absent ⇒ the field renders with the default cell in the read-only table. */\n table?: TableCellConfig<V>;\n /** Absent ⇒ the field renders as a read-only cell in editable surfaces. */\n editableTable?: EditableCellConfig<V>;\n /** Extra items for the field's \"more actions\" menu. */\n actions?: FieldActionsConfig;\n}\n\n/** Identity factory: infers `V` and keeps the definition's slots type-checked. */\nexport function defineFieldType<V>(\n definition: FieldTypeDefinition<V>,\n): FieldTypeDefinition<V> {\n return definition;\n}\n\n/** Resolves the definition a CUSTOM field references on its source. */\nexport function resolveFieldTypeDefinition(\n source: Pick<FieldsSource, 'fieldTypes'>,\n field: Field,\n) {\n if (field.type !== 'CUSTOM' || !field.customType) {\n return undefined;\n }\n return source.fieldTypes?.find((def) => def.type === field.customType);\n}\n"],"mappings":";;;;;;AAqEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CA;AACA;;AAQA;AACA;;AAMA;AACO,SAASA,kBAAkBA,CAChCC,MAAqC,EACT;EAC5B,OAAO,cAAc,IAAIA,MAAM;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAWA;;AAaA;;AAKA;;AASA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA;AACO,SAASC,eAAeA,CAC7BC,UAAkC,EACV;EACxB,OAAOA,UAAU;AACnB;;AAEA;AACO,SAASC,0BAA0BA,CACxCC,MAAwC,EACxCC,KAAY,EACZ;EAAA,IAAAC,kBAAA;EACA,IAAID,KAAK,CAACE,IAAI,KAAK,QAAQ,IAAI,CAACF,KAAK,CAACG,UAAU,EAAE;IAChD,OAAOC,SAAS;EAClB;EACA,QAAAH,kBAAA,GAAOF,MAAM,CAACM,UAAU,qBAAjBJ,kBAAA,CAAmBK,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACL,IAAI,KAAKF,KAAK,CAACG,UAAU,CAAC;AACxE","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["isFilterTypeConfig","filter","defineFieldType","definition","resolveFieldTypeDefinition","source","field","_source$fieldTypes","type","customType","undefined","fieldTypes","find","def"],"sources":["../../../src/types/FieldTypeDefinition.ts"],"sourcesContent":["import type {\n ComponentType,\n MutableRefObject,\n ReactElement,\n ReactNode,\n} from 'react';\nimport type { Field } from './Field';\nimport type { Filter } from '../model/filter';\nimport type {\n FieldPiiWarning,\n FieldSettingsSection,\n FieldsSource,\n} from './FieldsSource';\n\nexport type ValidationRule =\n | { type: 'required'; message: string }\n | { type: 'min' | 'max'; value: number; message: string }\n | { type: 'minLength' | 'maxLength'; value: number; message: string }\n | { type: 'pattern'; value: RegExp; message: string }\n | { type: 'custom'; validate: (value: unknown) => boolean; message: string }\n | {\n type: 'specificValues';\n values: { id: string; value: string }[];\n message: string;\n };\n\nexport interface Focusable {\n focus: () => void;\n}\n\nexport type EditTrigger =\n | { kind: 'type'; key: string }\n | 'enter'\n | 'click'\n | 'doubleClick';\n\nexport interface CellViewProps<V> {\n value: V;\n typeConfig?: unknown;\n validation?: ValidationRule[];\n /** Stable id of the column. Cell components can use it to derive unique DOM ids. */\n columnId: string;\n /** Stable key of the row. Cell components can use it to derive unique DOM ids. */\n rowKey: string;\n}\n\nexport interface CellEditProps<V> {\n value: V;\n // Method syntax keeps CellEditProps covariant in V (see FieldTypeDefinition).\n onChange(value: V): void;\n onCommit: () => void;\n onCancel: () => void;\n /**\n * Signals that the cell is starting an editing operation that will move focus\n * outside the table (e.g., opening a media manager or a modal). Calling this\n * sets isEditing=true so the table does not clear cell focus while the\n * external UI is open. Pair with onCommit (after the operation succeeds)\n * or onCancel (if the user dismisses without a value change).\n */\n onStartEdit?: () => void;\n /** Ref to the focusable input element. Used for type-to-edit (focusing the input when user starts typing on a focused cell). */\n inputRef?: MutableRefObject<Focusable | undefined | null>;\n typeConfig?: unknown;\n /** How edit mode was triggered. Edit components can use this to customize behavior (e.g., date picker auto-opens on 'type'). */\n editTrigger?: EditTrigger | null;\n /** Column-level validation rules. Edit components can derive UI behavior (e.g., maxLength blocking/tooltip) from these. */\n validation?: ValidationRule[];\n /** Stable id of the column. Cell components can use it to derive unique DOM ids. */\n columnId: string;\n /** Stable key of the row. Cell components can use it to derive unique DOM ids. */\n rowKey: string;\n}\n\n/**\n * Props passed to a cell type's optional `EditWrapper`. The table mounts the\n * wrapper around the cell content and keeps it mounted across the edit↔view\n * transition, so the wrapper can own behavior that must outlive the inline\n * editor (e.g. a reference cell navigating to an overlay and refreshing on\n * return). The wrapper hands anything the editor needs down via its own context.\n */\nexport interface CellEditWrapperProps {\n /** The column's typeConfig (same value handed to the cell's Edit/View). */\n typeConfig?: unknown;\n /** Stable id of the column. */\n columnId: string;\n /** Stable key of the row. */\n rowKey: string;\n /** The cell content (the Edit or View component) to render inside the wrapper. */\n children: ReactNode;\n}\n\n/**\n * The editable-cell slot of a field type definition: how a cell of that type\n * renders, edits, and moves through the clipboard. The definition's key\n * identifies the type and the definition's `value` owns validation, so the\n * slot carries neither.\n *\n * Members that take `V` use method syntax so a definition typed with a\n * concrete value type stays assignable where a loosely typed definition is\n * expected (see `FieldTypeDefinition`).\n */\nexport interface EditableCellConfig<V> {\n /** Render cell in view mode (read-only display). */\n ViewComponent(props: CellViewProps<V>): ReactElement | null;\n /** Render cell in edit mode (inline editor). Optional — omit for view-only cells. */\n EditComponent?(props: CellEditProps<V>): ReactElement | null;\n /** Serialize value to clipboard string. */\n serialize?(value: V): string;\n /** Deserialize clipboard string to value. */\n deserialize?(raw: string): V;\n /** Can this cell type be edited? (default: true) */\n editable?: boolean;\n /** Can this cell type be cleared with Delete key? (default: true) */\n clearable?: boolean;\n /** Toggle value on single click (e.g., boolean checkbox). Skips focus→edit flow. */\n toggleValue?(value: V): V;\n /** Enter edit mode on single click (e.g., image cell with no value). */\n editOnClick?(value: V): boolean;\n /** Show the EditComponent when the cell is focused, without entering edit mode.\n * Keyboard navigation remains active. Similar to toggleValue but without toggling. */\n showEditWhenFocused?: boolean;\n /** Optional wrapper component the cell type defines to own behavior that must\n * outlive the inline editor. Mounted around the cell content and kept mounted\n * across the edit↔view transition. */\n EditWrapper?: ComponentType<CellEditWrapperProps>;\n /** Cell content can grow past row height when focused. Only applies to\n * showEditWhenFocused cells. */\n growable?: boolean;\n /** Called on type-to-edit. Return object with cleared value and/or prevent flag.\n * Return undefined to block the key. Return {} to enter edit mode without changing the value. */\n onTypeToEdit?(params: {\n key: string;\n validation?: ValidationRule[];\n }): { value?: V } | undefined;\n /** Optional hook to normalize the committed value (e.g. auto-prepend https://).\n * Called before the edit commits; the value is written back before committing. */\n normalizeOnCommit?(value: V): V;\n /** When true, type-to-edit flushes the edit-mode render synchronously and\n * focuses the input within the same keydown event, then lets the browser's\n * default action deliver the keystroke to the now-focused input naturally.\n * Use for cells that wrap a controlled input whose value can't be seeded via props. */\n nativeTypeToEdit?: boolean;\n}\n\n/** The props the filter builder passes to a definition's toolbar filter\n * component — the same contract the built-in filter elements receive. */\nexport interface FilterTypeComponentProps<V = any> {\n filter: Filter<V>;\n toolbarItemProps?: { label?: ReactNode };\n toolbarTagProps?: { label?: string };\n accordionItemProps?: { label?: string };\n}\n\n/** The filter slot of a field type definition: the filter state registered on\n * the collection query and the toolbar element that renders it. */\nexport interface FilterTypeConfig {\n createFilter: (field: Field) => Filter<any>;\n Component: ComponentType<FilterTypeComponentProps>;\n}\n\n/** Narrows a definition's filter slot to an active filter config. */\nexport function isFilterTypeConfig(\n filter: FieldTypeDefinition['filter'],\n): filter is FilterTypeConfig {\n return 'createFilter' in filter;\n}\n\n/**\n * The read-only table slot of a field type definition: how a cell of that\n * type renders in the table, and the column's layout. Independent of\n * `editableTable` — neither slot falls back to the other.\n */\nexport interface TableCellConfig<V> {\n /** Render the cell. Method syntax keeps the definition assignable to\n * `FieldTypeDefinition<unknown>` (see FieldTypeDefinition). */\n CellComponent(props: { value: V }): ReactElement | null;\n /** Column width. Required — custom types get no built-in layout default. */\n width: string;\n /** Default: 'start'. */\n align?: 'start' | 'center' | 'end';\n}\n\n/** An extra menu item a field type definition adds to a field's actions menu. */\nexport interface FieldTypeActionItem {\n key: string;\n label: string;\n icon?: ReactNode;\n skin?: 'destructive';\n onClick: (field: Field) => void;\n /** Default: visible. */\n visible?: (field: Field) => boolean;\n /** Returning a string disables the item and shows the tooltip. */\n disabledTooltip?: (field: Field) => string | undefined;\n}\n\n/** The actions slot of a field type definition: extra items for the field's \"more actions\" menu. */\nexport interface FieldActionsConfig {\n items?: FieldTypeActionItem[];\n}\n\n/** Display metadata for a field type: menu label and type icons. */\nexport interface FieldTypeDisplay {\n label: string;\n icons: {\n Small: ComponentType;\n Medium: ComponentType;\n };\n}\n\n/** Value semantics of a field type, independent of any rendering surface.\n * Members use method syntax so a definition typed with a concrete value type\n * stays assignable where a loosely typed definition is expected. */\nexport interface FieldValueBehavior<V> {\n defaultValue?: V;\n isEmpty?(value: V): boolean;\n /** Returns an error message, or null when the value is valid. Every surface\n * that validates a field of this type runs this. */\n validate?(value: V, rules?: ValidationRule[]): string | null;\n}\n\nexport interface FieldCapabilities {\n sortable: boolean;\n}\n\n/** The field-modal slot of a field type definition: opts the type into the\n * add/edit-field modal's type picker and describes its entry there. */\nexport interface FieldModalConfig {\n /** True ⇒ the add-field modal offers this type. */\n creatable: boolean;\n /** Placeholder for the name input. Absent ⇒ the modal's generic placeholder. */\n namePlaceholder?: string;\n /** One-line description under the type in the picker. */\n subtitle?: string;\n /** Group heading this type is listed under in the picker. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source-wide setting. */\n supportsPii?: boolean;\n /** Warning shown while the PII toggle is on. Read on every render, so it can\n * use data that only exists once the schema has loaded. Default: none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's collapsible settings section — the same contract a\n * source-declared type option carries (see `FieldSettingsSection`). */\n settingsSection?: FieldSettingsSection;\n}\n\n/**\n * Props the entity-page form dispatcher passes to a field type's form\n * component. The dispatcher owns the form wiring (registration, validation\n * from the definition's `value.validate`) and the field UI (label, required\n * marker, error message) — the component renders only the input: read\n * `value`, report edits through `onChange`.\n */\nexport interface FormFieldComponentProps<V> {\n field: Field;\n value: V;\n // Method syntax keeps FormFieldComponentProps covariant in V (see FieldTypeDefinition).\n onChange(value: V): void;\n /** Call when the input loses focus — marks the field touched, so error\n * timing matches the built-in renderers. */\n onBlur: () => void;\n dataHook?: string;\n}\n\n/** The entity-page form slot of a field type definition. */\nexport interface FormTypeConfig<V = unknown> {\n /** Renders the input. Method syntax keeps the definition assignable to\n * `FieldTypeDefinition<unknown>` (see FieldTypeDefinition). */\n Component(props: FormFieldComponentProps<V>): ReactElement | null;\n}\n\n/**\n * A consumer-defined field type. Defined once on the fields source; every\n * entry point that renders the field resolves its slot from here. `V` is the\n * field's value type — `defineFieldType` infers it, and it keeps all the\n * slots consistent with each other.\n *\n * Sources hold definitions of mixed value types in one\n * `FieldTypeDefinition[]` (= `FieldTypeDefinition<unknown>[]`) array. That\n * works because every member that takes `V` is declared with method syntax,\n * which TypeScript checks bivariantly — so `FieldTypeDefinition<number>` is\n * assignable to `FieldTypeDefinition<unknown>` without casts.\n */\nexport interface FieldTypeDefinition<V = unknown> {\n /** Unique key for the type. A built-in type uses its `PatternsFieldType`; a\n * consumer-defined type uses the string its fields reference via `customType`. */\n type: string;\n display: FieldTypeDisplay;\n /** Filter behavior, or an explicit opt-out — never silently absent. */\n filter: FilterTypeConfig | { filterable: false };\n value?: FieldValueBehavior<V>;\n capabilities?: FieldCapabilities;\n /** Absent ⇒ the field renders with the default cell in the read-only table. */\n table?: TableCellConfig<V>;\n /** Absent ⇒ the field renders as a read-only cell in editable surfaces. */\n editableTable?: EditableCellConfig<V>;\n /** Required once a field of this type renders on an entity page:\n * development throws without it; production skips the field. */\n form?: FormTypeConfig<V>;\n /** Extra items for the field's \"more actions\" menu. */\n actions?: FieldActionsConfig;\n /** Absent ⇒ the add/edit field modal never offers this type. Fields of the\n * type created elsewhere still open in the modal for name/PII edits. */\n fieldModal?: FieldModalConfig;\n}\n\n/** Identity factory: infers `V` and keeps the definition's slots type-checked. */\nexport function defineFieldType<V>(\n definition: FieldTypeDefinition<V>,\n): FieldTypeDefinition<V> {\n return definition;\n}\n\n/** Resolves the definition a CUSTOM field references on its source. */\nexport function resolveFieldTypeDefinition(\n source: Pick<FieldsSource, 'fieldTypes'>,\n field: Field,\n) {\n if (field.type !== 'CUSTOM' || !field.customType) {\n return undefined;\n }\n return source.fieldTypes?.find((def) => def.type === field.customType);\n}\n"],"mappings":";;;;;;AAyEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CA;AACA;;AAQA;AACA;;AAMA;AACO,SAASA,kBAAkBA,CAChCC,MAAqC,EACT;EAC5B,OAAO,cAAc,IAAIA,MAAM;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAWA;;AAaA;;AAKA;;AASA;AACA;AACA;;AAaA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACO,SAASC,eAAeA,CAC7BC,UAAkC,EACV;EACxB,OAAOA,UAAU;AACnB;;AAEA;AACO,SAASC,0BAA0BA,CACxCC,MAAwC,EACxCC,KAAY,EACZ;EAAA,IAAAC,kBAAA;EACA,IAAID,KAAK,CAACE,IAAI,KAAK,QAAQ,IAAI,CAACF,KAAK,CAACG,UAAU,EAAE;IAChD,OAAOC,SAAS;EAClB;EACA,QAAAH,kBAAA,GAAOF,MAAM,CAACM,UAAU,qBAAjBJ,kBAAA,CAAmBK,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACL,IAAI,KAAKF,KAAK,CAACG,UAAU,CAAC;AACxE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/FieldsSource.ts"],"sourcesContent":["import type { ComponentType } from 'react';\nimport type { Field, PatternsFieldType } from './Field';\nimport type { FieldActions, FieldSettings, Schema } from './Schema';\nimport type { FieldTypeDefinition } from './FieldTypeDefinition';\n\n/** A field the source has archived. Sources without archiving omit `archive`. */\nexport interface ArchivedFieldItem {\n id: string;\n label: string;\n isPii?: boolean;\n}\n\n/** A `FieldTypeOption` the modal can render: the id and label a source left to\n * the defaults are filled in. */\nexport interface ResolvedFieldTypeOption {\n /** Stored on the draft; the source maps it back to its native type. */\n id: string;\n label: string;\n namePlaceholder?: string;\n subtitle?: string;\n /** Group heading in the type list; types sharing a heading form one group. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source-wide `supportsPii`. */\n supportsPii?: boolean;\n /** Warning to show while the PII toggle is on. Called on every render.\n * Absent ⇒ none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's own part of the collapsible section below the main fields.\n * Absent ⇒ the section holds only what the modal itself puts there. */\n settingsSection?: FieldSettingsSection;\n /** Drives the type icon in the modal. */\n patternsType: PatternsFieldType;\n}\n\n/** Read/write permission defaults a source supports, per audience. */\nexport interface FieldPermissions {\n installedApps?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n siteVisitors?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n}\n\n/** The values the add/edit field modal collects, source-neutral. */\nexport interface FieldDraft {\n type?: string;\n key: string;\n name: string;\n readApps: boolean;\n readUsers: boolean;\n writeApps: boolean;\n writeUsers: boolean;\n containsPii: boolean;\n /** The field this draft was built from, for the source's settings section to\n * read its own values off. Absent for a new field. */\n field?: Field;\n /** What the source's settings section collected, on its way to that source's\n * `addField`/`editField`. */\n settings?: FieldSettings;\n}\n\n/** The add-modal subtitle: a line of text, an optional second note line, and an\n * optional \"learn more\" link. */\nexport interface FieldModalSubtitle {\n text: string;\n note?: string;\n learnMore?: { label: string; href: string };\n}\n\n/** The text a source supplies for the add/edit field modal. */\nexport interface FieldModalText {\n addTitle: string;\n editTitle: string;\n /** Subtitle for the add modal; omit for none. */\n addSubtitle?: FieldModalSubtitle;\n /** Label of the collapsible section below the main fields. */\n settingsLabel?: string;\n}\n\n/** A warning shown under the PII toggle, with an optional action button. */\nexport interface FieldPiiWarning {\n text: string;\n action?: { label: string; onClick: () => void };\n}\n\nexport interface FieldSettingsProps {\n /** The picked field type, or absent before one is picked. */\n fieldType?: string;\n}\n\n/**\n * The collapsible section below the main add/edit field inputs, supplied by the\n * source. The modal renders it, blocks confirm while it has an error, and hands\n * its values to the source's own `addField`/`editField` — it never looks inside.\n */\nexport interface FieldSettingsSection {\n Component: ComponentType<FieldSettingsProps>;\n /** True keeps the modal open on confirm. The section shows the error itself. */\n hasError(fieldType?: string): boolean;\n /** Passed to `FieldActions.addField`/`editField` as-is. */\n getValues(fieldType?: string): FieldSettings;\n /**\n * Fills the inputs when the modal opens: the field being edited, or nothing\n * for a new field. Pushed in rather than read from a prop, so the values are\n * there whether or not the section has been rendered yet.\n */\n setValues(field?: Field): void;\n}\n\n/** Add/edit/delete capability a source exposes. Present ⇒ field management UI shows. */\nexport interface FieldManagement {\n /** False ⇒ the add-field CTA is hidden entirely. */\n canAddFields: boolean;\n /** True ⇒ the add-field CTA renders but is disabled. */\n addFieldDisabled: boolean;\n /** Hint text shown beneath the add-field CTA while it is disabled. */\n addFieldDisabledHint?: string;\n canEditField(field: Field): boolean;\n /** `origin` is the UI surface the delete was triggered from; used for BI. */\n deleteField(fieldId: string, origin: string): Promise<void>;\n\n /** Everything the add/edit field modal shows: its titles, and the field types\n * it offers with what each one brings to it. */\n fieldModal: {\n text: FieldModalText;\n types: ResolvedFieldTypeOption[];\n /** Defaults for the read/write permissions per audience. Absent ⇒ the modal\n * shows no permissions section. */\n permissions?: FieldPermissions;\n /** Whether a field can be marked PII. A field type option overrides it with\n * its own `supportsPii`. */\n supportsPii?: boolean;\n };\n /** Existing field keys, used by the add modal to reject duplicates. */\n existingFieldKeys: string[];\n /** True when no more fields can be added because a limit is reached. */\n maxReached?: boolean;\n addField(draft: FieldDraft): Promise<void>;\n editField(fieldId: string, draft: FieldDraft): Promise<void>;\n /** Current values for an existing field, to prefill the edit modal. */\n getFieldDraft(fieldId: string): FieldDraft | undefined;\n}\n\n/** Archiving capability a source exposes. Present ⇒ archive/restore UI shows. */\nexport interface FieldArchive {\n items: ArchivedFieldItem[];\n shouldDisplay: boolean;\n /** Whether the archived-items panel is currently open. */\n isOpen: boolean;\n openPanel(): void;\n closePanel(): void;\n /** `origin` is the UI surface the action was triggered from; used for BI. */\n archiveField(fieldId: string, origin: string): Promise<void>;\n restoreField(fieldId: string, origin: string): Promise<void>;\n /** Display name for a field, for the confirm-dialog copy. */\n fieldName(fieldId: string): string;\n}\n\n/**\n * The source-neutral fields data a collection reads, implemented by each source\n * adapter. Rendering — field modals, filter elements — is not here; it lives in\n * the collection-page layer.\n */\nexport interface FieldsSource {\n /** Loads the fields (schema/data). The collection runs this once, tracks its\n * status, and shows a retry toast on failure. */\n load(): Promise<void>;\n\n fields: Field[];\n filterableFields: Field[];\n /** The fields the manage-fields panel lists — the source's editable fields. */\n manageableFields: Field[];\n /** Column id for a field. Sources that group fields prefix the group; flat sources use the field key. */\n columnIdForField(field: Field): string;\n /** WQL field path for a filter. Sources that group fields prefix the group; flat sources use the field key. */\n queryFieldId(field: Field): string;\n /** The value to display for a field on a row. */\n getCellValue(row: unknown, field: Field): unknown;\n /** Writes a new value for a field on a row, returning the updated row. Present when cells can be edited in place. */\n setCellValue?(row: unknown, field: Field, value: unknown): unknown;\n\n /** Replaces the source's fields with a freshly-returned map, updating the\n * columns with no refetch. Present when the source holds its fields in a\n * mergeable state (e.g. a loaded schema); used after an import creates fields. */\n mergeFields?(fields: Schema['fields']): void;\n\n /** Field-type definitions the source supports: how a field of that type\n * renders, filters and validates. Built-in types are keyed by their\n * `PatternsFieldType`; consumer-defined types are keyed by the string a field\n * references via `customType`. The add/edit field modal never reads this —\n * see `FieldManagement.fieldModal`. */\n fieldTypes?: FieldTypeDefinition[];\n\n /** Present when fields can be added/edited/deleted. */\n fieldManagement?: FieldManagement;\n\n /** The collection's field-mutation actions (delete/makePrimary/duplicate/…),\n * driving the shared FieldActions menu. Absent ⇒ no per-field action menu. */\n fieldActions?: FieldActions;\n\n /** Present when the source supports archiving fields. */\n archive?: FieldArchive;\n\n /** Present when fields are grouped. Absent ⇒ flat list. */\n groups?: {\n all: string[];\n fieldsForGroup(group: string): Field[];\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/FieldsSource.ts"],"sourcesContent":["import type { ComponentType } from 'react';\nimport type { Field, PatternsFieldType } from './Field';\nimport type { FieldActions, FieldSettings, Schema } from './Schema';\nimport type { FieldTypeDefinition } from './FieldTypeDefinition';\n\n/** A field the source has archived. Sources without archiving omit `archive`. */\nexport interface ArchivedFieldItem {\n id: string;\n label: string;\n isPii?: boolean;\n}\n\n/** A `FieldTypeOption` the modal can render: the id and label a source left to\n * the defaults are filled in. */\nexport interface ResolvedFieldTypeOption {\n /** Stored on the draft; the source maps it back to its native type. */\n id: string;\n label: string;\n namePlaceholder?: string;\n subtitle?: string;\n /** Group heading in the type list; types sharing a heading form one group. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source-wide `supportsPii`. */\n supportsPii?: boolean;\n /** Warning to show while the PII toggle is on. Called on every render.\n * Absent ⇒ none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's own part of the collapsible section below the main fields.\n * Absent ⇒ the section holds only what the modal itself puts there. */\n settingsSection?: FieldSettingsSection;\n /** Drives the type icon in the modal. */\n patternsType: PatternsFieldType;\n /** Type icons for the picker. Absent ⇒ the icon derives from `patternsType`. */\n icons?: { Small: ComponentType; Medium: ComponentType };\n}\n\n/** Read/write permission defaults a source supports, per audience. */\nexport interface FieldPermissions {\n installedApps?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n siteVisitors?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n}\n\n/** The values the add/edit field modal collects, source-neutral. */\nexport interface FieldDraft {\n type?: string;\n key: string;\n name: string;\n readApps: boolean;\n readUsers: boolean;\n writeApps: boolean;\n writeUsers: boolean;\n containsPii: boolean;\n /** The field this draft was built from, for the source's settings section to\n * read its own values off. Absent for a new field. */\n field?: Field;\n /** What the source's settings section collected, on its way to that source's\n * `addField`/`editField`. */\n settings?: FieldSettings;\n}\n\n/** The add-modal subtitle: a line of text, an optional second note line, and an\n * optional \"learn more\" link. */\nexport interface FieldModalSubtitle {\n text: string;\n note?: string;\n learnMore?: { label: string; href: string };\n}\n\n/** The text a source supplies for the add/edit field modal. */\nexport interface FieldModalText {\n addTitle: string;\n editTitle: string;\n /** Subtitle for the add modal; omit for none. */\n addSubtitle?: FieldModalSubtitle;\n /** Label of the collapsible section below the main fields. */\n settingsLabel?: string;\n}\n\n/** A warning shown under the PII toggle, with an optional action button. */\nexport interface FieldPiiWarning {\n text: string;\n action?: { label: string; onClick: () => void };\n}\n\nexport interface FieldSettingsProps {\n /** The picked field type, or absent before one is picked. */\n fieldType?: string;\n}\n\n/**\n * The collapsible section below the main add/edit field inputs, supplied by the\n * source. The modal renders it, blocks confirm while it has an error, and hands\n * its values to the source's own `addField`/`editField` — it never looks inside.\n */\nexport interface FieldSettingsSection {\n Component: ComponentType<FieldSettingsProps>;\n /** True keeps the modal open on confirm. The section shows the error itself. */\n hasError(fieldType?: string): boolean;\n /** Passed to `FieldActions.addField`/`editField` as-is. */\n getValues(fieldType?: string): FieldSettings;\n /**\n * Fills the inputs when the modal opens: the field being edited, or nothing\n * for a new field. Pushed in rather than read from a prop, so the values are\n * there whether or not the section has been rendered yet.\n */\n setValues(field?: Field): void;\n}\n\n/** Add/edit/delete capability a source exposes. Present ⇒ field management UI shows. */\nexport interface FieldManagement {\n /** False ⇒ the add-field CTA is hidden entirely. */\n canAddFields: boolean;\n /** True ⇒ the add-field CTA renders but is disabled. */\n addFieldDisabled: boolean;\n /** Hint text shown beneath the add-field CTA while it is disabled. */\n addFieldDisabledHint?: string;\n canEditField(field: Field): boolean;\n /** `origin` is the UI surface the delete was triggered from; used for BI. */\n deleteField(fieldId: string, origin: string): Promise<void>;\n\n /** Everything the add/edit field modal shows: its titles, and the field types\n * it offers with what each one brings to it. */\n fieldModal: {\n text: FieldModalText;\n types: ResolvedFieldTypeOption[];\n /** Defaults for the read/write permissions per audience. Absent ⇒ the modal\n * shows no permissions section. */\n permissions?: FieldPermissions;\n /** Whether a field can be marked PII. A field type option overrides it with\n * its own `supportsPii`. */\n supportsPii?: boolean;\n };\n /** Existing field keys, used by the add modal to reject duplicates. */\n existingFieldKeys: string[];\n /** True when no more fields can be added because a limit is reached. */\n maxReached?: boolean;\n addField(draft: FieldDraft): Promise<void>;\n editField(fieldId: string, draft: FieldDraft): Promise<void>;\n /** Current values for an existing field, to prefill the edit modal. */\n getFieldDraft(fieldId: string): FieldDraft | undefined;\n}\n\n/** Archiving capability a source exposes. Present ⇒ archive/restore UI shows. */\nexport interface FieldArchive {\n items: ArchivedFieldItem[];\n shouldDisplay: boolean;\n /** Whether the archived-items panel is currently open. */\n isOpen: boolean;\n openPanel(): void;\n closePanel(): void;\n /** `origin` is the UI surface the action was triggered from; used for BI. */\n archiveField(fieldId: string, origin: string): Promise<void>;\n restoreField(fieldId: string, origin: string): Promise<void>;\n /** Display name for a field, for the confirm-dialog copy. */\n fieldName(fieldId: string): string;\n}\n\n/**\n * The source-neutral fields data a collection reads, implemented by each source\n * adapter. Rendering — field modals, filter elements — is not here; it lives in\n * the collection-page layer.\n */\nexport interface FieldsSource {\n /** Loads the fields (schema/data). The collection runs this once, tracks its\n * status, and shows a retry toast on failure. */\n load(): Promise<void>;\n\n fields: Field[];\n filterableFields: Field[];\n /** The fields the manage-fields panel lists — the source's editable fields. */\n manageableFields: Field[];\n /** Column id for a field. Sources that group fields prefix the group; flat sources use the field key. */\n columnIdForField(field: Field): string;\n /** WQL field path for a filter. Sources that group fields prefix the group; flat sources use the field key. */\n queryFieldId(field: Field): string;\n /** The value to display for a field on a row. */\n getCellValue(row: unknown, field: Field): unknown;\n /** Writes a new value for a field on a row, returning the updated row. Present when cells can be edited in place. */\n setCellValue?(row: unknown, field: Field, value: unknown): unknown;\n\n /** Replaces the source's fields with a freshly-returned map, updating the\n * columns with no refetch. Present when the source holds its fields in a\n * mergeable state (e.g. a loaded schema); used after an import creates fields. */\n mergeFields?(fields: Schema['fields']): void;\n\n /** Field-type definitions the source supports: how a field of that type\n * renders, filters and validates. Built-in types are keyed by their\n * `PatternsFieldType`; consumer-defined types are keyed by the string a field\n * references via `customType`. The add/edit field modal never reads this —\n * see `FieldManagement.fieldModal`. */\n fieldTypes?: FieldTypeDefinition[];\n\n /** Present when fields can be added/edited/deleted. */\n fieldManagement?: FieldManagement;\n\n /** The collection's field-mutation actions (delete/makePrimary/duplicate/…),\n * driving the shared FieldActions menu. Absent ⇒ no per-field action menu. */\n fieldActions?: FieldActions;\n\n /** Present when the source supports archiving fields. */\n archive?: FieldArchive;\n\n /** Present when fields are grouped. Absent ⇒ flat list. */\n groups?: {\n all: string[];\n fieldsForGroup(group: string): Field[];\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public data model for the Setup widget ("Focus Widget").
|
|
3
|
-
*
|
|
4
|
-
* The widget follows the "pluggable adapter" design (Option C): the consumer
|
|
5
|
-
* supplies a promise-returning `fetchData`, and the widget owns loading / error
|
|
6
|
-
* / refetch state itself. This keeps the data source swappable (Dealer-direct,
|
|
7
|
-
* patterns-service, or a static fixture) behind a single component.
|
|
8
|
-
*/
|
|
9
1
|
export {};
|
|
10
2
|
//# sourceMappingURL=setupWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupWidget.js","sourceRoot":"","sources":["../../../src/model/setupWidget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setupWidget.js","sourceRoot":"","sources":["../../../src/model/setupWidget.ts"],"names":[],"mappings":""}
|
|
@@ -18,6 +18,7 @@ export class QueryResultState {
|
|
|
18
18
|
this._pagesAtom = createAtom('QueryResultState.pages');
|
|
19
19
|
this._pages = { processed: [], unprocessed: [] };
|
|
20
20
|
this._totals = { processed: 0, unprocessed: 0 };
|
|
21
|
+
this._localItemsCount = 0;
|
|
21
22
|
this._supportTotal = false;
|
|
22
23
|
this._hasNext = undefined;
|
|
23
24
|
this.available = null;
|
|
@@ -51,15 +52,18 @@ export class QueryResultState {
|
|
|
51
52
|
total: computed,
|
|
52
53
|
hasAvailableItems: computed,
|
|
53
54
|
_totals: observable.ref,
|
|
55
|
+
_localItemsCount: observable.ref,
|
|
54
56
|
_supportTotal: observable.ref,
|
|
55
57
|
_hasNext: observable.ref,
|
|
56
58
|
hasNext: computed,
|
|
57
59
|
setTotals: action,
|
|
60
|
+
resetLocalItemsCount: action,
|
|
58
61
|
setHasNext: action,
|
|
59
62
|
available: observable.ref,
|
|
60
63
|
status: observable.ref,
|
|
61
64
|
originQuery: observable.ref,
|
|
62
65
|
changeItems: action,
|
|
66
|
+
incrementTotal: action,
|
|
63
67
|
totalStatus: computed,
|
|
64
68
|
slice: action,
|
|
65
69
|
});
|
|
@@ -109,7 +113,8 @@ export class QueryResultState {
|
|
|
109
113
|
return flatMap(pages);
|
|
110
114
|
}
|
|
111
115
|
get total() {
|
|
112
|
-
return this.fetchTotal ? this.fetchTotal.total : this._totals.processed
|
|
116
|
+
return Math.max((this.fetchTotal ? this.fetchTotal.total : this._totals.processed) +
|
|
117
|
+
this._localItemsCount, 0);
|
|
113
118
|
}
|
|
114
119
|
get totalStatus() {
|
|
115
120
|
return this.fetchTotal ? this.fetchTotal.status : this.status.status;
|
|
@@ -188,17 +193,20 @@ export class QueryResultState {
|
|
|
188
193
|
const { _pages, _pagesAtom } = this;
|
|
189
194
|
_pages.processed = [newItems, ..._pages.processed];
|
|
190
195
|
_pages.unprocessed = [newItems, ..._pages.unprocessed];
|
|
196
|
+
this.incrementTotal(newItems.length);
|
|
191
197
|
_pagesAtom.reportChanged();
|
|
192
198
|
return {
|
|
193
199
|
rollback: () => {
|
|
194
200
|
_pages.processed = _pages.processed.slice(1);
|
|
195
201
|
_pages.unprocessed = _pages.unprocessed.slice(1);
|
|
202
|
+
this.incrementTotal(-newItems.length);
|
|
196
203
|
_pagesAtom.reportChanged();
|
|
197
204
|
},
|
|
198
205
|
};
|
|
199
206
|
}
|
|
200
207
|
clear() {
|
|
201
208
|
this.setNewPages({ processed: [], unprocessed: [] });
|
|
209
|
+
this.resetLocalItemsCount();
|
|
202
210
|
}
|
|
203
211
|
addPages(morePages) {
|
|
204
212
|
const { _pages } = this;
|
|
@@ -210,6 +218,19 @@ export class QueryResultState {
|
|
|
210
218
|
setTotals(totals) {
|
|
211
219
|
this._totals = totals;
|
|
212
220
|
}
|
|
221
|
+
incrementTotal(delta) {
|
|
222
|
+
if (this.fetchTotal) {
|
|
223
|
+
this._localItemsCount = Math.max(this._localItemsCount + delta, 0);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
this.setTotals({
|
|
227
|
+
processed: Math.max(this._totals.processed + delta, 0),
|
|
228
|
+
unprocessed: Math.max(this._totals.unprocessed + delta, 0),
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
resetLocalItemsCount() {
|
|
232
|
+
this._localItemsCount = 0;
|
|
233
|
+
}
|
|
213
234
|
setSupportTotal(supportTotal) {
|
|
214
235
|
this._supportTotal = supportTotal;
|
|
215
236
|
}
|
|
@@ -225,6 +246,7 @@ export class QueryResultState {
|
|
|
225
246
|
unprocessed: _pages.unprocessed.slice(start, end),
|
|
226
247
|
processed: _pages.processed.slice(start, end),
|
|
227
248
|
});
|
|
249
|
+
this.resetLocalItemsCount();
|
|
228
250
|
}
|
|
229
251
|
get hasAvailableItems() {
|
|
230
252
|
const { originQuery: { hasNonPersistentActiveFilters }, available, total, size, } = this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryResultState.js","sourceRoot":"","sources":["../../../src/state/QueryResultState.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,WAAW,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAChF,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAiBrC,MAAM,OAAO,gBAAgB;
|
|
1
|
+
{"version":3,"file":"QueryResultState.js","sourceRoot":"","sources":["../../../src/state/QueryResultState.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,WAAW,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAChF,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAiBrC,MAAM,OAAO,gBAAgB;IAc3B,IAAI,KAAK;QACP,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,cAAc;QAChB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAC5B,MAAM,GAAG,GAAG,IAAI,GAAG,EAAwB,CAAC;QAC5C,KAAK,M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AC,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YACjD,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;SAC9C,CAAC,CAAC;QACH,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED,IAAI,iBAAiB;QACnB,MAAM,EACJ,WAAW,EAAE,EAAE,6BAA6B,EAAE,EAC9C,SAAS,EACT,KAAK,EACL,IAAI,GACL,GAAG,IAAI,CAAC;QACT,kHAAkH;QAClH,OAAO,SAAS,IAAI,IAAI;YACtB,CAAC,CAAC,SAAS,GAAG,CAAC;YACf,CAAC,CAAC,6BAA6B,IAAI,KAAK,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,UAAU;QACZ,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAClC,OAAO;YACL,KAAK;YACL,SAAS,EAAE,SAAS,IAAI,CAAC;SAC1B,CAAC;IACJ,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -241,7 +241,8 @@ export class WixPatternsContainer {
|
|
|
241
241
|
}
|
|
242
242
|
get useRelativeSidePanel() {
|
|
243
243
|
return (this._useRelativeSidePanel ||
|
|
244
|
-
this.internalExperiments?.enabled('
|
|
244
|
+
(this.internalExperiments?.enabled('useRelativeSidePanel') &&
|
|
245
|
+
this.experiments.enabled('bmHarmonyTheme')));
|
|
245
246
|
}
|
|
246
247
|
init() {
|
|
247
248
|
const { onlineState } = this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WixPatternsContainer.js","sourceRoot":"","sources":["../../../src/state/WixPatternsContainer.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,iBAAiB,EAGjB,sBAAsB,EAOtB,kBAAkB,GACnB,MAAM,aAAa,CAAC;A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AE,OAAO;aACnB,CAAC;SACH,CAAC;IACJ,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC;IACrC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAI,oBAAoB;QACtB,OAAO,CACL,IAAI,CAAC,qBAAqB;YAC1B,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,sBAAsB,CAAC;gBACxD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAC9C,CAAC;IACJ,CAAC;IAED,IAAI;QACF,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAE7B,IAAI,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YAC9B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG;YAChB,WAAW,CAAC,IAAI,EAAE;YAClB,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE;SACzC,CAAC;QAEF,OAAO,GAAG,EAAE;YACV,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAClC,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldTypeDefinition.js","sourceRoot":"","sources":["../../../src/types/FieldTypeDefinition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FieldTypeDefinition.js","sourceRoot":"","sources":["../../../src/types/FieldTypeDefinition.ts"],"names":[],"mappings":"AAgKA,qEAAqE;AACrE,MAAM,UAAU,kBAAkB,CAChC,MAAqC;IAErC,OAAO,cAAc,IAAI,MAAM,CAAC;AAClC,CAAC;AA6ID,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAC7B,UAAkC;IAElC,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,0BAA0B,CACxC,MAAwC,EACxC,KAAY;IAEZ,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;QAChD,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,UAAU,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* Public data model for the Setup widget ("Focus Widget").
|
|
3
4
|
*
|
|
@@ -12,6 +13,21 @@
|
|
|
12
13
|
* actionable step) — the data never pins it, matching dashboard-setup.
|
|
13
14
|
*/
|
|
14
15
|
export type SetupWidgetStepStatus = 'upcoming' | 'in-progress' | 'completed' | 'disabled';
|
|
16
|
+
/**
|
|
17
|
+
* An extra icon-only action on a step, shown next to its CTA (e.g. an AI
|
|
18
|
+
* shortcut). Clicking it fires the widget's `onStepSecondaryClick`.
|
|
19
|
+
*/
|
|
20
|
+
export interface SetupWidgetStepSecondaryCta {
|
|
21
|
+
/** Icon rendered inside the button — an icon element, e.g. `<AI />`. */
|
|
22
|
+
icon: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Accessible name for the button. Required: the button renders an icon and
|
|
25
|
+
* nothing else, so without it screen readers have no way to name the action.
|
|
26
|
+
*/
|
|
27
|
+
ariaLabel: string;
|
|
28
|
+
/** Tooltip shown on hover. */
|
|
29
|
+
tooltip?: string;
|
|
30
|
+
}
|
|
15
31
|
export interface SetupWidgetStep {
|
|
16
32
|
/** Stable identifier, used as the React key and for inline-expansion toggling. */
|
|
17
33
|
id: string;
|
|
@@ -33,6 +49,14 @@ export interface SetupWidgetStep {
|
|
|
33
49
|
* back to a generic "you don't have access" message when omitted.
|
|
34
50
|
*/
|
|
35
51
|
disabledTooltip?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Icon-only action rendered before the step's CTA on desktop rows — leaf
|
|
54
|
+
* steps, aggregated group rows and their children alike. Mobile cards have no
|
|
55
|
+
* per-step CTA and ignore it. Only offered while the step is still actionable:
|
|
56
|
+
* a completed step drops it along with its CTA, and a group drops it once all
|
|
57
|
+
* its children are done.
|
|
58
|
+
*/
|
|
59
|
+
secondaryCta?: SetupWidgetStepSecondaryCta;
|
|
36
60
|
status: SetupWidgetStepStatus;
|
|
37
61
|
/**
|
|
38
62
|
* What happens when the row is activated:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupWidget.d.ts","sourceRoot":"","sources":["../../../src/model/setupWidget.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAC7B,UAAU,GACV,aAAa,GACb,WAAW,GACX,UAAU,CAAC;AAEf,MAAM,WAAW,eAAe;IAC9B,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,qBAAqB,CAAC;IAC9B;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IACtC;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED,8CAA8C;AAC9C,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,KAAK,EAAE,eAAe,EAAE,CAAC;CA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sEAAsE;AACtE,MAAM,WAAW,iBAAiB;IAChC,6EAA6E;IAC7E,SAAS,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;CAC3C"}
|
|
@@ -16,6 +16,7 @@ export declare class QueryResultState<T, F extends FiltersMap> implements QueryR
|
|
|
16
16
|
readonly _pagesAtom: import("mobx").IAtom;
|
|
17
17
|
_pages: Pages<T>;
|
|
18
18
|
_totals: Totals;
|
|
19
|
+
_localItemsCount: number;
|
|
19
20
|
_supportTotal: boolean;
|
|
20
21
|
_hasNext?: boolean | null;
|
|
21
22
|
readonly fetchTotal?: FetchTotalState<T, F>;
|
|
@@ -51,6 +52,8 @@ export declare class QueryResultState<T, F extends FiltersMap> implements QueryR
|
|
|
51
52
|
clear(): void;
|
|
52
53
|
addPages(morePages: Pages<T>): void;
|
|
53
54
|
setTotals(totals: Totals): void;
|
|
55
|
+
incrementTotal(delta: number): void;
|
|
56
|
+
resetLocalItemsCount(): void;
|
|
54
57
|
setSupportTotal(supportTotal: boolean): void;
|
|
55
58
|
setHasNext(hasNext?: boolean | null): void;
|
|
56
59
|
setPages(pages: Pages<T>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryResultState.d.ts","sourceRoot":"","sources":["../../../src/state/QueryResultState.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,SAAS,EACT,WAAW,EACX,iBAAiB,EAElB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,UAAU,eAAe,CAAC,CAAC;IACzB,SAAS,EAAE,CAAC,CAAC;IACb,WAAW,EAAE,CAAC,CAAC;CAChB;AAED,KAAK,KAAK,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACvC,KAAK,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAEtC,MAAM,WAAW,sBAAsB,CAAC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AAK,EAAE,OAAO;IAIhC,wBAAwB,CAAC,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE;IAIvD,cAAc,2BAA0B,QAAQ,CA8B9C;IAEI,YAAY;IAmBlB,IAAI,cAAc;;;;MAajB;IAED,IAAI,aAAa,YAEhB;IAED,IAAI,QAAQ,YAEX;IAED,IAAI,oBAAoB,wBAMvB;IAED,IAAI;CAgBL"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentType, MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type { Field } from './Field';
|
|
3
3
|
import type { Filter } from '../model/filter';
|
|
4
|
-
import type { FieldsSource } from './FieldsSource';
|
|
4
|
+
import type { FieldPiiWarning, FieldSettingsSection, FieldsSource } from './FieldsSource';
|
|
5
5
|
export type ValidationRule = {
|
|
6
6
|
type: 'required';
|
|
7
7
|
message: string;
|
|
@@ -216,6 +216,49 @@ export interface FieldValueBehavior<V> {
|
|
|
216
216
|
export interface FieldCapabilities {
|
|
217
217
|
sortable: boolean;
|
|
218
218
|
}
|
|
219
|
+
/** The field-modal slot of a field type definition: opts the type into the
|
|
220
|
+
* add/edit-field modal's type picker and describes its entry there. */
|
|
221
|
+
export interface FieldModalConfig {
|
|
222
|
+
/** True ⇒ the add-field modal offers this type. */
|
|
223
|
+
creatable: boolean;
|
|
224
|
+
/** Placeholder for the name input. Absent ⇒ the modal's generic placeholder. */
|
|
225
|
+
namePlaceholder?: string;
|
|
226
|
+
/** One-line description under the type in the picker. */
|
|
227
|
+
subtitle?: string;
|
|
228
|
+
/** Group heading this type is listed under in the picker. */
|
|
229
|
+
group?: string;
|
|
230
|
+
/** Whether a field of this type can be marked PII. Absent ⇒ follows the
|
|
231
|
+
* source-wide setting. */
|
|
232
|
+
supportsPii?: boolean;
|
|
233
|
+
/** Warning shown while the PII toggle is on. Read on every render, so it can
|
|
234
|
+
* use data that only exists once the schema has loaded. Default: none. */
|
|
235
|
+
piiWarning?: () => FieldPiiWarning | undefined;
|
|
236
|
+
/** This type's collapsible settings section — the same contract a
|
|
237
|
+
* source-declared type option carries (see `FieldSettingsSection`). */
|
|
238
|
+
settingsSection?: FieldSettingsSection;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Props the entity-page form dispatcher passes to a field type's form
|
|
242
|
+
* component. The dispatcher owns the form wiring (registration, validation
|
|
243
|
+
* from the definition's `value.validate`) and the field UI (label, required
|
|
244
|
+
* marker, error message) — the component renders only the input: read
|
|
245
|
+
* `value`, report edits through `onChange`.
|
|
246
|
+
*/
|
|
247
|
+
export interface FormFieldComponentProps<V> {
|
|
248
|
+
field: Field;
|
|
249
|
+
value: V;
|
|
250
|
+
onChange(value: V): void;
|
|
251
|
+
/** Call when the input loses focus — marks the field touched, so error
|
|
252
|
+
* timing matches the built-in renderers. */
|
|
253
|
+
onBlur: () => void;
|
|
254
|
+
dataHook?: string;
|
|
255
|
+
}
|
|
256
|
+
/** The entity-page form slot of a field type definition. */
|
|
257
|
+
export interface FormTypeConfig<V = unknown> {
|
|
258
|
+
/** Renders the input. Method syntax keeps the definition assignable to
|
|
259
|
+
* `FieldTypeDefinition<unknown>` (see FieldTypeDefinition). */
|
|
260
|
+
Component(props: FormFieldComponentProps<V>): ReactElement | null;
|
|
261
|
+
}
|
|
219
262
|
/**
|
|
220
263
|
* A consumer-defined field type. Defined once on the fields source; every
|
|
221
264
|
* entry point that renders the field resolves its slot from here. `V` is the
|
|
@@ -243,8 +286,14 @@ export interface FieldTypeDefinition<V = unknown> {
|
|
|
243
286
|
table?: TableCellConfig<V>;
|
|
244
287
|
/** Absent ⇒ the field renders as a read-only cell in editable surfaces. */
|
|
245
288
|
editableTable?: EditableCellConfig<V>;
|
|
289
|
+
/** Required once a field of this type renders on an entity page:
|
|
290
|
+
* development throws without it; production skips the field. */
|
|
291
|
+
form?: FormTypeConfig<V>;
|
|
246
292
|
/** Extra items for the field's "more actions" menu. */
|
|
247
293
|
actions?: FieldActionsConfig;
|
|
294
|
+
/** Absent ⇒ the add/edit field modal never offers this type. Fields of the
|
|
295
|
+
* type created elsewhere still open in the modal for name/PII edits. */
|
|
296
|
+
fieldModal?: FieldModalConfig;
|
|
248
297
|
}
|
|
249
298
|
/** Identity factory: infers `V` and keeps the definition's slots type-checked. */
|
|
250
299
|
export declare function defineFieldType<V>(definition: FieldTypeDefinition<V>): FieldTypeDefinition<V>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldTypeDefinition.d.ts","sourceRoot":"","sources":["../../../src/types/FieldTypeDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"FieldTypeDefinition.d.ts","sourceRoot":"","sources":["../../../src/types/FieldTypeDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;IAA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,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACtC;qEACiE;IACjE,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IACzB,uDAAuD;IACvD,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B;6EACyE;IACzE,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,CAAC,EAC/B,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,GACjC,mBAAmB,CAAC,CAAC,CAAC,CAExB;AAED,uEAAuE;AACvE,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,EACxC,KAAK,EAAE,KAAK,4CAMb"}
|
|
@@ -29,6 +29,11 @@ export interface ResolvedFieldTypeOption {
|
|
|
29
29
|
settingsSection?: FieldSettingsSection;
|
|
30
30
|
/** Drives the type icon in the modal. */
|
|
31
31
|
patternsType: PatternsFieldType;
|
|
32
|
+
/** Type icons for the picker. Absent ⇒ the icon derives from `patternsType`. */
|
|
33
|
+
icons?: {
|
|
34
|
+
Small: ComponentType;
|
|
35
|
+
Medium: ComponentType;
|
|
36
|
+
};
|
|
32
37
|
}
|
|
33
38
|
/** Read/write permission defaults a source supports, per audience. */
|
|
34
39
|
export interface FieldPermissions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldsSource.d.ts","sourceRoot":"","sources":["../../../src/types/FieldsSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,iFAAiF;AACjF,MAAM,WAAW,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E,KAAK,EAAE,CAAC;IAC1B,+EAA+E;IAC/E,gBAAgB,EAAE,KAAK,EAAE,CAAC;IAC1B,yGAAyG;IACzG,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;IACvC,+GAA+G;IAC/G,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;IACnC,iDAAiD;IACjD,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IAClD,qHAAqH;IACrH,YAAY,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IAEnE;;uFAEmF;IACnF,WAAW,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE7C;;;;4CAIwC;IACxC,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEnC,uDAAuD;IACvD,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;mFAC+E;IAC/E,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,yDAAyD;IACzD,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB,2DAA2D;IAC3D,MAAM,CAAC,EAAE;QACP,GAAG,EAAE,MAAM,EAAE,CAAC;QACd,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;KACxC,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/bex-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.349.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Kobi",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"exports"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@wix/bex-utils": "2.
|
|
44
|
+
"@wix/bex-utils": "2.136.0",
|
|
45
45
|
"chance": "^1.0.0",
|
|
46
46
|
"events": "^3.0.0",
|
|
47
47
|
"formstate": "^2.1.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@types/react": "^16.0.0",
|
|
64
64
|
"@wix/auto-crud": "^1.0.108",
|
|
65
65
|
"@wix/babel-cli": "^1.11.0",
|
|
66
|
-
"@wix/cairo-integration-utils": "1.
|
|
66
|
+
"@wix/cairo-integration-utils": "1.111.0",
|
|
67
67
|
"@wix/eslint-config-yoshi": "^6.74.0",
|
|
68
68
|
"@wix/fe-essentials": "^1.233.0",
|
|
69
69
|
"@wix/fe-essentials-standalone": "^1.374.0",
|
|
@@ -169,5 +169,5 @@
|
|
|
169
169
|
"wallaby": {
|
|
170
170
|
"autoDetect": true
|
|
171
171
|
},
|
|
172
|
-
"falconPackageHash": "
|
|
172
|
+
"falconPackageHash": "5ba1db6ecc1878a50fd93b7262289a3b7e7000de5cef6b165865b568"
|
|
173
173
|
}
|