@gooddata/sdk-ui-analytical-designer 11.65.0-alpha.9 → 11.65.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/NOTICE +536 -2137
- package/README.md +31 -57
- package/esm/components/CustomDragLayer.d.ts.map +1 -1
- package/esm/components/CustomDragLayer.js +0 -1
- package/esm/components/DragScroller/DragScroller.d.ts.map +1 -1
- package/esm/components/DragScroller/DragScroller.js +0 -1
- package/esm/components/Messages.d.ts.map +1 -1
- package/esm/components/Messages.js +13 -11
- package/esm/components/buckets/BucketIcon.d.ts +1 -1
- package/esm/components/buckets/BucketIcon.d.ts.map +1 -1
- package/esm/components/buckets/BucketIcon.js +11 -161
- package/esm/components/buckets/MeasureAttributeFilterPickerBody.d.ts.map +1 -1
- package/esm/components/buckets/MeasureAttributeFilterPickerBody.js +0 -1
- package/esm/embedding/AnalyticalDesigner.d.ts.map +1 -1
- package/esm/embedding/AnalyticalDesigner.js +2 -3
- package/esm/embedding/AnalyticalDesignerEmbedded.d.ts +5 -2
- package/esm/embedding/AnalyticalDesignerEmbedded.d.ts.map +1 -1
- package/esm/embedding/AnalyticalDesignerEmbedded.js +1 -2
- package/esm/embedding/analyticalDesignerConfig.d.ts +0 -6
- package/esm/embedding/analyticalDesignerConfig.d.ts.map +1 -1
- package/esm/embedding/analyticalDesignerConfig.js +0 -36
- package/esm/embedding/analyticalDesignerTypes.d.ts +119 -104
- package/esm/embedding/analyticalDesignerTypes.d.ts.map +1 -1
- package/esm/embedding/hostBridge.d.ts +2 -9
- package/esm/embedding/hostBridge.d.ts.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/models/metadata.d.ts +17 -4
- package/esm/models/metadata.d.ts.map +1 -1
- package/esm/models/metadata.js +103 -25
- package/esm/postMessageApi/outgoing/drill_events.d.ts.map +1 -1
- package/esm/postMessageApi/outgoing/drill_events.js +10 -3
- package/esm/postMessageApi/outgoing/post_event_helper.d.ts +11 -1
- package/esm/postMessageApi/outgoing/post_event_helper.d.ts.map +1 -1
- package/esm/postMessageApi/outgoing/post_event_helper.js +22 -13
- package/esm/sagas/open_report_sagas.d.ts +6 -0
- package/esm/sagas/open_report_sagas.d.ts.map +1 -1
- package/esm/sagas/open_report_sagas.js +13 -8
- package/esm/sdk-ui-analytical-designer.d.ts +112 -95
- package/esm/selectors/buckets_selector.d.ts +44 -4
- package/esm/selectors/buckets_selector.d.ts.map +1 -1
- package/esm/selectors/buckets_selector.js +5 -5
- package/esm/selectors/date_datasets_selector.d.ts +88 -8
- package/esm/selectors/date_datasets_selector.d.ts.map +1 -1
- package/esm/selectors/dialogs_selector.d.ts +11 -11
- package/esm/selectors/insight_selectors.d.ts +110 -10
- package/esm/selectors/insight_selectors.d.ts.map +1 -1
- package/esm/selectors/report_selector.d.ts +44 -4
- package/esm/selectors/report_selector.d.ts.map +1 -1
- package/esm/selectors/report_visualization_selector.d.ts +26 -6
- package/esm/selectors/report_visualization_selector.d.ts.map +1 -1
- package/esm/selectors/save_report_from_kd_dialog_selector.d.ts +11 -11
- package/esm/selectors/save_report_selector.d.ts +3 -0
- package/esm/selectors/save_report_selector.d.ts.map +1 -1
- package/esm/selectors/save_report_selector.js +18 -2
- package/esm/selectors/uri_selector.d.ts +5 -6
- package/esm/selectors/uri_selector.d.ts.map +1 -1
- package/esm/selectors/uri_selector.js +1 -10
- package/esm/services/bootstrap_error_service.d.ts.map +1 -1
- package/esm/services/bootstrap_error_service.js +5 -14
- package/esm/translations/de-DE.json +0 -22
- package/esm/translations/en-AU.json +0 -22
- package/esm/translations/en-GB.json +3 -25
- package/esm/translations/es-419.json +0 -22
- package/esm/translations/es-ES.json +13 -35
- package/esm/translations/fi-FI.json +0 -22
- package/esm/translations/fr-CA.json +0 -22
- package/esm/translations/fr-FR.json +21 -43
- package/esm/translations/id-ID.json +0 -22
- package/esm/translations/it-IT.json +0 -22
- package/esm/translations/ja-JP.json +0 -22
- package/esm/translations/ko-KR.json +0 -22
- package/esm/translations/nl-NL.json +0 -22
- package/esm/translations/pl-PL.json +0 -22
- package/esm/translations/pt-BR.json +0 -22
- package/esm/translations/pt-PT.json +0 -22
- package/esm/translations/ru-RU.json +0 -22
- package/esm/translations/sl-SI.json +0 -22
- package/esm/translations/th-TH.json +0 -22
- package/esm/translations/tr-TR.json +0 -22
- package/esm/translations/uk-UA.json +0 -22
- package/esm/translations/vi-VN.json +0 -22
- package/esm/translations/zh-HK.json +0 -22
- package/esm/translations/zh-Hans.json +0 -22
- package/esm/translations/zh-Hant.json +0 -22
- package/package.json +21 -22
- package/styles/css/buckets.css +7 -0
- package/styles/css/buckets.css.map +1 -1
- package/styles/css/editor_header.css +1 -1
- package/styles/css/editor_header.css.map +1 -1
- package/styles/css/main.css +11 -1
- package/styles/css/main.css.map +1 -1
- package/styles/css/typo.css +3 -0
- package/styles/css/typo.css.map +1 -1
- package/styles/scss/buckets.scss +10 -0
- package/styles/scss/editor_header.scss +1 -1
- package/styles/scss/typo.scss +4 -0
- package/esm/embedding/embeddedCallbacks.d.ts +0 -31
- package/esm/embedding/embeddedCallbacks.d.ts.map +0 -1
- package/esm/embedding/embeddedCallbacks.js +0 -59
package/README.md
CHANGED
|
@@ -43,39 +43,6 @@ React peers:
|
|
|
43
43
|
With the same version, the host and AD share one copy of each SDK package, so they share its React
|
|
44
44
|
contexts and the bundle contains one SDK.
|
|
45
45
|
|
|
46
|
-
### Vite configuration
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
// vite.config.ts
|
|
50
|
-
import react from "@vitejs/plugin-react";
|
|
51
|
-
import { defineConfig } from "vite";
|
|
52
|
-
|
|
53
|
-
export default defineConfig({
|
|
54
|
-
plugins: [react()],
|
|
55
|
-
define: {
|
|
56
|
-
// Legacy CommonJS dependencies bundled with AD read these.
|
|
57
|
-
global: "globalThis",
|
|
58
|
-
"process.env": "{}",
|
|
59
|
-
},
|
|
60
|
-
optimizeDeps: {
|
|
61
|
-
rolldownOptions: {
|
|
62
|
-
// The metric editor in AD imports its Monaco worker with `?worker&url`, which the
|
|
63
|
-
// dependency pre-bundler cannot load. Leave that import external, so Vite's own
|
|
64
|
-
// pipeline resolves it to the worker URL when it serves the pre-bundled chunk.
|
|
65
|
-
plugins: [
|
|
66
|
-
{
|
|
67
|
-
name: "external-worker-url",
|
|
68
|
-
resolveId: (id: string) => (/\?worker(&url)?$/.test(id) ? { id, external: true } : null),
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Without the `optimizeDeps` plugin, the dev server stops while it pre-bundles dependencies, with
|
|
77
|
-
`[UNLOADABLE_DEPENDENCY] Could not load …/editorWebWorkerMain.js?worker&url`. See Workers below.
|
|
78
|
-
|
|
79
46
|
### Backend
|
|
80
47
|
|
|
81
48
|
AD runs on the host's backend. When the backend caches, give AD the cache resets, so the catalog
|
|
@@ -149,8 +116,7 @@ export function App() {
|
|
|
149
116
|
config={{ locale: "en-US" }}
|
|
150
117
|
cacheReset={cacheReset}
|
|
151
118
|
slots={slots}
|
|
152
|
-
|
|
153
|
-
onInsightSaved={({ insight }) => console.log("saved", insight)}
|
|
119
|
+
onEvent={(event) => console.log(event.type, event.data)}
|
|
154
120
|
onError={(error) => console.error("AD error", error)}
|
|
155
121
|
/>
|
|
156
122
|
</div>
|
|
@@ -169,19 +135,20 @@ Leave out `insight` to open a new insight. The AnalyticalDesigner component sect
|
|
|
169
135
|
built with. AD mounts its own backend, workspace and theme providers, so it runs next to a host on
|
|
170
136
|
another SDK version. Align the versions when host components and AD components have to share a
|
|
171
137
|
React context from the SDK, and to avoid bundling two SDK copies.
|
|
172
|
-
- **Build-time defines**: `
|
|
173
|
-
|
|
138
|
+
- **Build-time defines**: `process.env` must be defined (`{}`). The MAQL parser of the metric editor
|
|
139
|
+
(`antlr4ts`) loads the `assert` and `util` polyfills, which read it when they load. No other
|
|
140
|
+
define is needed: AD does not read `global`. The
|
|
174
141
|
build flags `DEBUG`, `TESTING`, `READONLY_MODE` and `TIGER_API_TOKEN` are optional: the code reads
|
|
175
142
|
them behind `typeof` guards and falls back to production defaults, so define them only to change
|
|
176
143
|
that behavior. `modules/gdc-analytical-designer/module/vite.config.ts` is the reference setup.
|
|
177
|
-
- **Workers**:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
144
|
+
- **Workers**: no setup is needed in Vite or webpack. The metric editor
|
|
145
|
+
(`@gooddata/sdk-ui-metric-component`) ships Monaco's editor worker bundled into one file. It starts
|
|
146
|
+
the worker from that file when the bundler emitted it next to the page, and from a Blob of the same
|
|
147
|
+
code otherwise, for example in the Vite dev server or when the editor loads from another origin. A
|
|
148
|
+
content security policy must then allow `blob:` workers. A page that enforces Trusted Types must
|
|
149
|
+
allow the `gdMetricEditorWorker` policy, or create it through
|
|
150
|
+
`MonacoEnvironment.createTrustedTypesPolicy`. A host that sets its own `MonacoEnvironment`
|
|
151
|
+
(`getWorker` or `getWorkerUrl`) before the editor loads keeps its own workers.
|
|
185
152
|
|
|
186
153
|
- **Import side effects**: importing an entry creates no router and no browser history. `Root`
|
|
187
154
|
creates its router when it mounts: a `BrowserRouter` under the host's base path in the pluggable
|
|
@@ -244,8 +211,16 @@ import "@gooddata/sdk-ui-analytical-designer/styles/css/main.css";
|
|
|
244
211
|
insight="insight-id"
|
|
245
212
|
config={{ locale: "en-US", hiddenActions: ["open"], isReadOnly: false }}
|
|
246
213
|
cacheReset={cacheReset}
|
|
247
|
-
|
|
248
|
-
|
|
214
|
+
onEvent={(event) => {
|
|
215
|
+
switch (event.type) {
|
|
216
|
+
case "visualizationSaved":
|
|
217
|
+
console.log("saved", event.data.insight);
|
|
218
|
+
break;
|
|
219
|
+
case "metricsChanged":
|
|
220
|
+
console.log("metrics changed");
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
}}
|
|
249
224
|
/>
|
|
250
225
|
</WorkspaceProvider>
|
|
251
226
|
</BackendProvider>;
|
|
@@ -267,16 +242,15 @@ import "@gooddata/sdk-ui-analytical-designer/styles/css/main.css";
|
|
|
267
242
|
`isEmbedded`, `allowDashboardLinks`) follow the props.
|
|
268
243
|
- **Theme**: `theme` replaces the workspace theme, `disableThemeLoading` skips it, and
|
|
269
244
|
`themeModifier` changes the theme AD applies.
|
|
270
|
-
- **Events**: `
|
|
271
|
-
|
|
272
|
-
`
|
|
273
|
-
|
|
274
|
-
`
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
(`resetAll`, `resetCatalogs`; the `CacheControl` of `withCaching` fits): AD calls it when the user
|
|
245
|
+
- **Events**: `onEvent` gets every event AD emits as an `AnalyticalDesignerEvent`: `type`, `data`
|
|
246
|
+
and the `contextId` of the command the event answers. Checking `type` narrows `data`;
|
|
247
|
+
`IAnalyticalDesignerEventDataMap` lists the payload of each type. The types are the names of the
|
|
248
|
+
`@gooddata/sdk-embedding` contract (`visualizationSaved`, `insightEditingCancelled`,
|
|
249
|
+
`insightOpened`, `appCommandFailed`, `undoFinished`, ...), plus `metricsChanged`, when the user
|
|
250
|
+
saves or deletes a metric, and `availableCommands`. The `drill` event carries the `IDrillEvent` of
|
|
251
|
+
`@gooddata/sdk-ui`. `onError` fires when AD cannot start. A host that shares a caching backend
|
|
252
|
+
with AD passes `cacheReset` (`resetAll`, `resetCatalogs`; the `CacheControl` of `withCaching`
|
|
253
|
+
fits): AD calls it when the user
|
|
280
254
|
refreshes the catalog or edits a metric, before it reloads the data.
|
|
281
255
|
- **Commands**: `apiRef` takes `clear`, `requestCancellation`, `setFilterContext` and
|
|
282
256
|
`sendCommand`. Commands sent before AD mounts run once it does.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDragLayer.d.ts","sourceRoot":"","sources":["../../src/components/CustomDragLayer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomDragLayer.d.ts","sourceRoot":"","sources":["../../src/components/CustomDragLayer.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMnD,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAgB3F,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,qBAAqB,EAC/B,KAAK,EAAE,qBAAqB,EAC5B,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,qBAAqB,KAAK,IAAI,EACnF,QAAQ,GAAE,QAAQ,CAAC,MAAM,CAAY,EACrC,cAAc,GAAE;IAAE,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;CAAgC,QAmD7F;AAED,UAAU,qBAAqB;IAC3B,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,UAAU,wBAAwB;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GAAG,qBAAqB,CAAC;AAEpF,UAAU,OAAO;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,qBAAqB;IAClC,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,wBAAwB,kDAqC/D"}
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { useDragLayer } from "@evil-internetmann/react-dnd";
|
|
5
|
-
import CustomEvent from "custom-event";
|
|
6
5
|
import { useDispatch } from "react-redux";
|
|
7
6
|
import { GOODSTRAP_DRAG_EVENT } from "@gooddata/sdk-ui-kit";
|
|
8
7
|
import { dragItemFailed } from "../sagas/drag_and_drop/drag_and_drop_actions.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragScroller.d.ts","sourceRoot":"","sources":["../../../src/components/DragScroller/DragScroller.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAkC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DragScroller.d.ts","sourceRoot":"","sources":["../../../src/components/DragScroller/DragScroller.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAkC,MAAM,OAAO,CAAC;AAe3F,MAAM,WAAW,kBAAkB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,CACP,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,KAChB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACrC,sBAAsB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,IAAI,KAAK,MAAM,CAAC;IAChE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,YAAY,CAAC,EACzB,SAAc,EACd,QAAQ,EACR,QAA6B,EAC7B,sBAAkE,EAClE,cAA0C,EAC1C,MAAM,EAAE,UAAmB,GAC9B,EAAE,kBAAkB,2CAgLpB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2021-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useEffect, useRef } from "react";
|
|
4
|
-
import CustomEvent from "custom-event";
|
|
5
4
|
import { throttle } from "lodash-es";
|
|
6
5
|
import { GOODSTRAP_SCROLLED_EVENT } from "@gooddata/sdk-ui-kit";
|
|
7
6
|
import { smoothingGenerator } from "./cd_smooth.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Messages.d.ts","sourceRoot":"","sources":["../../src/components/Messages.tsx"],"names":[],"mappings":"AAcA,wBAAgB,QAAQ,
|
|
1
|
+
{"version":3,"file":"Messages.d.ts","sourceRoot":"","sources":["../../src/components/Messages.tsx"],"names":[],"mappings":"AAcA,wBAAgB,QAAQ,4CA2CvB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
|
-
import { useCallback } from "react";
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { useDispatch, useSelector } from "react-redux";
|
|
6
6
|
import { NonContextToastsInterop } from "@gooddata/sdk-ui-kit";
|
|
@@ -13,15 +13,10 @@ export function Messages() {
|
|
|
13
13
|
const onDismissMessage = useCallback((messageId) => {
|
|
14
14
|
dispatch(hideMessage(messageId));
|
|
15
15
|
}, [dispatch]);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
const formatted = intl.formatMessage({ id }, { ...values, b: bold });
|
|
21
|
-
return typeof formatted === "string" ? { text: formatted } : { text: "", node: formatted };
|
|
22
|
-
}
|
|
23
|
-
const localizedMessages = messages
|
|
24
|
-
.map((message) => ({ ...message, ...formatMessage(message) }))
|
|
16
|
+
// The toasts interop re-adds every message whose reference changed, so the messages keep their
|
|
17
|
+
// identity across the renders that do not change them.
|
|
18
|
+
const localizedMessages = useMemo(() => messages
|
|
19
|
+
.map((message) => ({ ...message, ...formatMessage(intl, message) }))
|
|
25
20
|
.map((message) => {
|
|
26
21
|
const errorDetails = message.errorDetails || undefined;
|
|
27
22
|
if (errorDetails) {
|
|
@@ -34,13 +29,20 @@ export function Messages() {
|
|
|
34
29
|
};
|
|
35
30
|
}
|
|
36
31
|
return message;
|
|
37
|
-
});
|
|
32
|
+
}), [messages, intl]);
|
|
38
33
|
return (_jsx(NonContextToastsInterop
|
|
39
34
|
// the runtime message shape matches the ui-kit toast contract; the repo model is wider
|
|
40
35
|
, {
|
|
41
36
|
// the runtime message shape matches the ui-kit toast contract; the repo model is wider
|
|
42
37
|
messages: localizedMessages, onDismissMessage: onDismissMessage }));
|
|
43
38
|
}
|
|
39
|
+
function formatMessage(intl, { text: id, values }) {
|
|
40
|
+
if (!id) {
|
|
41
|
+
return { text: "" };
|
|
42
|
+
}
|
|
43
|
+
const formatted = intl.formatMessage({ id }, { ...values, b: bold });
|
|
44
|
+
return typeof formatted === "string" ? { text: formatted } : { text: "", node: formatted };
|
|
45
|
+
}
|
|
44
46
|
function bold(chunks) {
|
|
45
47
|
return _jsx("strong", { children: chunks });
|
|
46
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BucketIcon.d.ts","sourceRoot":"","sources":["../../../src/components/buckets/BucketIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BucketIcon.d.ts","sourceRoot":"","sources":["../../../src/components/buckets/BucketIcon.tsx"],"names":[],"mappings":"AAUA,UAAU,gBAAgB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,gBAAgB,2CAoBpD"}
|
|
@@ -1,171 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
3
|
import { useMemo } from "react";
|
|
4
|
-
import
|
|
5
|
-
import areaStackIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/area/bucket-title-stack.svg";
|
|
6
|
-
import areaViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/area/bucket-title-view.svg";
|
|
7
|
-
import barMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bar/bucket-title-measures.svg";
|
|
8
|
-
import barStackIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bar/bucket-title-stack.svg";
|
|
9
|
-
import barViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bar/bucket-title-view.svg";
|
|
10
|
-
import bubbleMeasuresXIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bubble/bucket-title-measures-x.svg";
|
|
11
|
-
import bubbleMeasuresYIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bubble/bucket-title-measures-y.svg";
|
|
12
|
-
import bubbleSizeIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bubble/bucket-title-size.svg";
|
|
13
|
-
import bubbleViewByIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bubble/bucket-title-view-by.svg";
|
|
14
|
-
import bulletComparativeMeasureIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bullet/bucket-title-comparative.svg";
|
|
15
|
-
import bulletPrimaryMeasureIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bullet/bucket-title-primary.svg";
|
|
16
|
-
import bulletTargetMeasureIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bullet/bucket-title-target.svg";
|
|
17
|
-
import bulletViewByIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/bullet/bucket-title-view-by.svg";
|
|
18
|
-
import columnMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/column/bucket-title-measures.svg";
|
|
19
|
-
import columnStackIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/column/bucket-title-stack.svg";
|
|
20
|
-
import columnViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/column/bucket-title-view.svg";
|
|
21
|
-
import areaMeasureIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/combo/bucket-title-measures-area.svg";
|
|
22
|
-
import columnMeasureIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/combo/bucket-title-measures-column.svg";
|
|
23
|
-
import lineMeasureIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/combo/bucket-title-measures-line.svg";
|
|
24
|
-
import comboSecondaryMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/combo/bucket-title-secondary-measures.svg";
|
|
25
|
-
import columnAreaIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/combo/bucket-title-view-column-area.svg";
|
|
26
|
-
import columnLineIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/combo/bucket-title-view-column-line.svg";
|
|
27
|
-
import lineAreaIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/combo/bucket-title-view-line-area.svg";
|
|
28
|
-
import lineViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/combo/bucket-title-view-line-line.svg";
|
|
29
|
-
import dependencyWheelAttributeFromIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/dependencyWheel/bucket-title-from.svg";
|
|
30
|
-
import dependencyWheelMeasureIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/dependencyWheel/bucket-title-measures.svg";
|
|
31
|
-
import dependencyWheelAttributeToIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/dependencyWheel/bucket-title-to.svg";
|
|
32
|
-
import donutMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/donut/bucket-title-measures.svg";
|
|
33
|
-
import donutViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/donut/bucket-title-view.svg";
|
|
34
|
-
import funnelMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/funnel/bucket-title-measures.svg";
|
|
35
|
-
import funnelViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/funnel/bucket-title-view.svg";
|
|
36
|
-
import geoPushPinBucketColorIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/geoPushpin/bucket-title-color-icon.svg";
|
|
37
|
-
import geoPushPinBucketLocationIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/geoPushpin/bucket-title-location-icon.svg";
|
|
38
|
-
import geoPushPinBucketSegmentIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/geoPushpin/bucket-title-segment-icon.svg";
|
|
39
|
-
import geoPushPinBucketSizeIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/geoPushpin/bucket-title-size-icon.svg";
|
|
40
|
-
import headlineMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/headline/bucket-title-measures.svg";
|
|
41
|
-
import headlineSecondaryMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/headline/bucket-title-secondary-measures.svg";
|
|
42
|
-
import heatmapMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/heatmap/bucket-title-measures.svg";
|
|
43
|
-
import heatmapStackIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/heatmap/bucket-title-stack.svg";
|
|
44
|
-
import heatmapViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/heatmap/bucket-title-view.svg";
|
|
45
|
-
import lineMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/line/bucket-title-measures.svg";
|
|
46
|
-
import lineSegmentIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/line/bucket-title-segment.svg";
|
|
47
|
-
import lineTrendIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/line/bucket-title-trend.svg";
|
|
48
|
-
import mekkoHeightIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/mekko/bucket-title-height.svg";
|
|
49
|
-
import mekkoStackIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/mekko/bucket-title-stack.svg";
|
|
50
|
-
import mekkoViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/mekko/bucket-title-view.svg";
|
|
51
|
-
import mekkoWidthIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/mekko/bucket-title-width.svg";
|
|
52
|
-
import pieMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/pie/bucket-title-measures.svg";
|
|
53
|
-
import pieViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/pie/bucket-title-view.svg";
|
|
54
|
-
import pyramidMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/pyramid/bucket-title-measures.svg";
|
|
55
|
-
import pyramidViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/pyramid/bucket-title-view.svg";
|
|
56
|
-
import radarMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/radar/bucket-title-measures.svg";
|
|
57
|
-
import radarSegmentIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/radar/bucket-title-segment.svg";
|
|
58
|
-
import radarTrendIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/radar/bucket-title-trend.svg";
|
|
59
|
-
import repeaterColumnsIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/repeater/bucket-title-columns.svg";
|
|
60
|
-
import repeaterRowsIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/repeater/bucket-title-rows.svg";
|
|
61
|
-
import repeaterViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/repeater/bucket-title-view.svg";
|
|
62
|
-
import sankeyAttributeFromIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/sankey/bucket-title-from.svg";
|
|
63
|
-
import sankeyMeasureIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/sankey/bucket-title-measures.svg";
|
|
64
|
-
import sankeyAttributeToIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/sankey/bucket-title-to.svg";
|
|
65
|
-
import scatterAttributeIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/scatter/bucket-title-attribute.svg";
|
|
66
|
-
import scatterMeasuresXIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/scatter/bucket-title-measures-x.svg";
|
|
67
|
-
import scatterMeasuresYIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/scatter/bucket-title-measures-y.svg";
|
|
68
|
-
import scatterSegmentIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/scatter/bucket-title-segment.svg";
|
|
69
|
-
import scatterViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/scatter/bucket-title-view.svg";
|
|
70
|
-
import tableColumnsIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/table/bucket-title-columns.svg";
|
|
71
|
-
import tableMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/table/bucket-title-measures.svg";
|
|
72
|
-
import tableRowsIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/table/bucket-title-rows.svg";
|
|
73
|
-
import treemapMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/treemap/bucket-title-measures.svg";
|
|
74
|
-
import treemapSegmentIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/treemap/bucket-title-segment.svg";
|
|
75
|
-
import treemapViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/treemap/bucket-title-view.svg";
|
|
76
|
-
import waterfallMeasuresIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/waterfall/bucket-title-measures.svg";
|
|
77
|
-
import waterfallViewIcon from "@gooddata/sdk-ui-ext/esm/internal/assets/waterfall/bucket-title-view.svg";
|
|
78
|
-
const localBucketIcons = {
|
|
79
|
-
"area/bucket-title-measures.svg": areaMeasuresIcon,
|
|
80
|
-
"area/bucket-title-view.svg": areaViewIcon,
|
|
81
|
-
"area/bucket-title-stack.svg": areaStackIcon,
|
|
82
|
-
"column/bucket-title-measures.svg": columnMeasuresIcon,
|
|
83
|
-
"column/bucket-title-view.svg": columnViewIcon,
|
|
84
|
-
"column/bucket-title-stack.svg": columnStackIcon,
|
|
85
|
-
"bar/bucket-title-measures.svg": barMeasuresIcon,
|
|
86
|
-
"bar/bucket-title-view.svg": barViewIcon,
|
|
87
|
-
"bar/bucket-title-stack.svg": barStackIcon,
|
|
88
|
-
"bubble/bucket-title-measures-x.svg": bubbleMeasuresXIcon,
|
|
89
|
-
"bubble/bucket-title-measures-y.svg": bubbleMeasuresYIcon,
|
|
90
|
-
"bubble/bucket-title-size.svg": bubbleSizeIcon,
|
|
91
|
-
"bubble/bucket-title-view-by.svg": bubbleViewByIcon,
|
|
92
|
-
"bullet/bucket-title-primary.svg": bulletPrimaryMeasureIcon,
|
|
93
|
-
"bullet/bucket-title-target.svg": bulletTargetMeasureIcon,
|
|
94
|
-
"bullet/bucket-title-comparative.svg": bulletComparativeMeasureIcon,
|
|
95
|
-
"bullet/bucket-title-view-by.svg": bulletViewByIcon,
|
|
96
|
-
"combo/bucket-title-measures-column.svg": columnMeasureIcon,
|
|
97
|
-
"combo/bucket-title-measures-line.svg": lineMeasureIcon,
|
|
98
|
-
"combo/bucket-title-measures-area.svg": areaMeasureIcon,
|
|
99
|
-
"combo/bucket-title-view-column-line.svg": columnLineIcon,
|
|
100
|
-
"combo/bucket-title-view-column-area.svg": columnAreaIcon,
|
|
101
|
-
"combo/bucket-title-view-line-area.svg": lineAreaIcon,
|
|
102
|
-
"combo/bucket-title-view-line-line.svg": lineViewIcon,
|
|
103
|
-
"combo/bucket-title-secondary-measures.svg": comboSecondaryMeasuresIcon,
|
|
104
|
-
"donut/bucket-title-measures.svg": donutMeasuresIcon,
|
|
105
|
-
"donut/bucket-title-view.svg": donutViewIcon,
|
|
106
|
-
"funnel/bucket-title-measures.svg": funnelMeasuresIcon,
|
|
107
|
-
"funnel/bucket-title-view.svg": funnelViewIcon,
|
|
108
|
-
"pyramid/bucket-title-measures.svg": pyramidMeasuresIcon,
|
|
109
|
-
"pyramid/bucket-title-view.svg": pyramidViewIcon,
|
|
110
|
-
"geoPushpin/bucket-title-location-icon.svg": geoPushPinBucketLocationIcon,
|
|
111
|
-
"geoPushpin/bucket-title-size-icon.svg": geoPushPinBucketSizeIcon,
|
|
112
|
-
"geoPushpin/bucket-title-color-icon.svg": geoPushPinBucketColorIcon,
|
|
113
|
-
"geoPushpin/bucket-title-segment-icon.svg": geoPushPinBucketSegmentIcon,
|
|
114
|
-
"headline/bucket-title-measures.svg": headlineMeasuresIcon,
|
|
115
|
-
"headline/bucket-title-secondary-measures.svg": headlineSecondaryMeasuresIcon,
|
|
116
|
-
"heatmap/bucket-title-measures.svg": heatmapMeasuresIcon,
|
|
117
|
-
"heatmap/bucket-title-view.svg": heatmapViewIcon,
|
|
118
|
-
"heatmap/bucket-title-stack.svg": heatmapStackIcon,
|
|
119
|
-
"line/bucket-title-measures.svg": lineMeasuresIcon,
|
|
120
|
-
"line/bucket-title-trend.svg": lineTrendIcon,
|
|
121
|
-
"line/bucket-title-segment.svg": lineSegmentIcon,
|
|
122
|
-
"pie/bucket-title-measures.svg": pieMeasuresIcon,
|
|
123
|
-
"pie/bucket-title-view.svg": pieViewIcon,
|
|
124
|
-
"table/bucket-title-measures.svg": tableMeasuresIcon,
|
|
125
|
-
"table/bucket-title-rows.svg": tableRowsIcon,
|
|
126
|
-
"table/bucket-title-columns.svg": tableColumnsIcon,
|
|
127
|
-
"scatter/bucket-title-measures-x.svg": scatterMeasuresXIcon,
|
|
128
|
-
"scatter/bucket-title-measures-y.svg": scatterMeasuresYIcon,
|
|
129
|
-
"scatter/bucket-title-attribute.svg": scatterAttributeIcon,
|
|
130
|
-
"scatter/bucket-title-view.svg": scatterViewIcon,
|
|
131
|
-
"scatter/bucket-title-segment.svg": scatterSegmentIcon,
|
|
132
|
-
"treemap/bucket-title-measures.svg": treemapMeasuresIcon,
|
|
133
|
-
"treemap/bucket-title-view.svg": treemapViewIcon,
|
|
134
|
-
"treemap/bucket-title-segment.svg": treemapSegmentIcon,
|
|
135
|
-
"sankey/bucket-title-measures.svg": sankeyMeasureIcon,
|
|
136
|
-
"sankey/bucket-title-from.svg": sankeyAttributeFromIcon,
|
|
137
|
-
"sankey/bucket-title-to.svg": sankeyAttributeToIcon,
|
|
138
|
-
"dependencyWheel/bucket-title-measures.svg": dependencyWheelMeasureIcon,
|
|
139
|
-
"dependencyWheel/bucket-title-from.svg": dependencyWheelAttributeFromIcon,
|
|
140
|
-
"dependencyWheel/bucket-title-to.svg": dependencyWheelAttributeToIcon,
|
|
141
|
-
"waterfall/bucket-title-measures.svg": waterfallMeasuresIcon,
|
|
142
|
-
"waterfall/bucket-title-view.svg": waterfallViewIcon,
|
|
143
|
-
"radar/bucket-title-measures.svg": radarMeasuresIcon,
|
|
144
|
-
"radar/bucket-title-trend.svg": radarTrendIcon,
|
|
145
|
-
"radar/bucket-title-segment.svg": radarSegmentIcon,
|
|
146
|
-
"repeater/bucket-title-rows.svg": repeaterRowsIcon,
|
|
147
|
-
"repeater/bucket-title-columns.svg": repeaterColumnsIcon,
|
|
148
|
-
"repeater/bucket-title-view.svg": repeaterViewIcon,
|
|
149
|
-
"mekko/bucket-title-width.svg": mekkoWidthIcon,
|
|
150
|
-
"mekko/bucket-title-height.svg": mekkoHeightIcon,
|
|
151
|
-
"mekko/bucket-title-view.svg": mekkoViewIcon,
|
|
152
|
-
"mekko/bucket-title-stack.svg": mekkoStackIcon,
|
|
153
|
-
};
|
|
4
|
+
import { getBucketIcon } from "@gooddata/sdk-ui-ext/internal";
|
|
154
5
|
function isLocalBucketIcon(icon) {
|
|
155
|
-
return
|
|
156
|
-
}
|
|
157
|
-
function getLocalBucketIcon(icon) {
|
|
158
|
-
const localId = icon.replace("local:", "");
|
|
159
|
-
return localBucketIcons[localId];
|
|
6
|
+
return !!icon && icon.startsWith("local:");
|
|
160
7
|
}
|
|
161
8
|
export function BucketIcon({ icon }) {
|
|
162
|
-
|
|
9
|
+
// Called as a plain render function, the same way the ui-kit InsightIcon renders its map entries.
|
|
10
|
+
const renderLocalIcon = getBucketIcon(icon);
|
|
11
|
+
// Anything that is not a known `local:` id is treated as an external image URL.
|
|
12
|
+
const externalIconUrl = !renderLocalIcon && !isLocalBucketIcon(icon) ? icon : undefined;
|
|
163
13
|
const style = useMemo(() => {
|
|
164
|
-
return
|
|
14
|
+
return externalIconUrl
|
|
165
15
|
? {
|
|
166
|
-
backgroundImage: `url("${
|
|
16
|
+
backgroundImage: `url("${externalIconUrl}")`,
|
|
167
17
|
}
|
|
168
|
-
:
|
|
169
|
-
}, [
|
|
170
|
-
return _jsx("div", { className: "bucket-title-icon", style: style });
|
|
18
|
+
: undefined;
|
|
19
|
+
}, [externalIconUrl]);
|
|
20
|
+
return (_jsx("div", { className: "bucket-title-icon", style: style, children: renderLocalIcon ? renderLocalIcon({ ariaHidden: true }) : null }));
|
|
171
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeasureAttributeFilterPickerBody.d.ts","sourceRoot":"","sources":["../../../src/components/buckets/MeasureAttributeFilterPickerBody.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MeasureAttributeFilterPickerBody.d.ts","sourceRoot":"","sources":["../../../src/components/buckets/MeasureAttributeFilterPickerBody.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAKrE,OAAO,EACH,KAAK,2BAA2B,EAEnC,MAAM,wCAAwC,CAAC;AAEhD,eAAO,MAAM,yCAAyC,KAAK,CAAC;AAG5D,MAAM,WAAW,sCAAsC;IACnD,UAAU,EAAE,oBAAoB,CAAC;IACjC,+FAA+F;IAC/F,KAAK,EAAE,2BAA2B,EAAE,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAC;CACzD;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,EAC7C,UAAU,EACV,KAAK,EACL,SAAS,EACT,UAAU,EACV,QAAQ,GACX,EAAE,sCAAsC,2CA2ExC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2019-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
-
import CustomEvent from "custom-event";
|
|
5
4
|
import { useIntl } from "react-intl";
|
|
6
5
|
import { GOODSTRAP_SCROLLED_EVENT, Input } from "@gooddata/sdk-ui-kit";
|
|
7
6
|
import { LoadingDropdown } from "../shared/LoadingDropdown.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticalDesigner.d.ts","sourceRoot":"","sources":["../../src/embedding/AnalyticalDesigner.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,GAAG,EAMX,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAKlE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"AnalyticalDesigner.d.ts","sourceRoot":"","sources":["../../src/embedding/AnalyticalDesigner.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,GAAG,EAMX,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAKlE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAY/C,OAAO,EACH,KAAK,sBAAsB,EAE3B,KAAK,wBAAwB,EAChC,MAAM,8BAA8B,CAAC;AAOtC,iFAAiF;AACjF,MAAM,WAAW,8BAA+B,SAAQ,sBAAsB;IAC1E,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC/C;AAED,mFAAmF;AACnF,MAAM,WAAW,gCAAiC,SAAQ,IAAI,CAAC,wBAAwB,EAAE,QAAQ,CAAC;IAC9F,8EAA8E;IAC9E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,CAAC,8BAA8B,CAAC,CAAC;CAChD;AAwDD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,gCAAgC,GAAG,YAAY,CA+HhG;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,CAgBhF"}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useCallback, useEffect, useImperativeHandle, useRef, useState, } from "react";
|
|
4
4
|
import { ErrorComponent, LoadingComponent, useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
5
5
|
import { backendBootstrapData, loadSettings } from "../sagas/bootstrap/backendBootstrapData.js";
|
|
6
|
-
import { applyConfigToBootstrapData, resolveRouteIdentifiers, resolveTheme, routeTargetKey,
|
|
6
|
+
import { applyConfigToBootstrapData, resolveRouteIdentifiers, resolveTheme, routeTargetKey, toRouteConfig, } from "./analyticalDesignerConfig.js";
|
|
7
7
|
import { AnalyticalDesignerEmbedded } from "./AnalyticalDesignerEmbedded.js";
|
|
8
8
|
import { renderSlot, } from "./slots.js";
|
|
9
9
|
const NO_CONFIG = {};
|
|
@@ -128,7 +128,6 @@ export function AnalyticalDesignerInternal(props) {
|
|
|
128
128
|
if (!hostData || !route) {
|
|
129
129
|
return renderSlot(props.slots?.Loading, DefaultLoading, {});
|
|
130
130
|
}
|
|
131
|
-
const callbacks = toEmbeddedCallbacks(props);
|
|
132
131
|
return (_jsx(AnalyticalDesignerEmbedded, { config: toRouteConfig(route.identifiers, config), host: {
|
|
133
132
|
workspaceId: mount.workspace,
|
|
134
133
|
bootstrapData: hostData.bootstrapData,
|
|
@@ -139,7 +138,7 @@ export function AnalyticalDesignerInternal(props) {
|
|
|
139
138
|
locale: config.locale,
|
|
140
139
|
telemetryCallbacks: config.telemetryCallbacks,
|
|
141
140
|
isReadOnly: config.isReadOnly,
|
|
142
|
-
}, callbacks:
|
|
141
|
+
}, callbacks: { onEvent: props.onEvent, onError: props.onError }, apiRef: embeddedApiRef, slots: props.slots }));
|
|
143
142
|
}
|
|
144
143
|
/**
|
|
145
144
|
* Analytical Designer as a React component.
|
|
@@ -5,8 +5,8 @@ import { type IWorkspacePermissions } from "@gooddata/sdk-model";
|
|
|
5
5
|
import { type IBootstrapData } from "../actions/app_context_actions.js";
|
|
6
6
|
import { type IAdHostBackend, type IApiToken } from "../backend.js";
|
|
7
7
|
import { type IHostTelemetryCallbacks } from "../services/telemetry/tracker.js";
|
|
8
|
+
import { type IAnalyticalDesignerProps } from "./analyticalDesignerTypes.js";
|
|
8
9
|
import { type IAdEmbeddedRouteConfig } from "./buildEmbeddedHash.js";
|
|
9
|
-
import { type IAdEmbeddedCallbacks } from "./embeddedCallbacks.js";
|
|
10
10
|
import { type AdCommandEnvelope } from "./hostBridge.js";
|
|
11
11
|
import { type IAnalyticalDesignerSlots } from "./slots.js";
|
|
12
12
|
/**
|
|
@@ -47,12 +47,14 @@ export interface IAdEmbeddedApi {
|
|
|
47
47
|
setFilterContext(data: IFilterContextContent, contextId?: string): void;
|
|
48
48
|
setApiToken(body: IAdSetApiTokenBody): void;
|
|
49
49
|
}
|
|
50
|
+
/** The callbacks AD delivers its events and its start failures to. */
|
|
51
|
+
type AdEmbeddedCallbacks = Pick<IAnalyticalDesignerProps, "onEvent" | "onError">;
|
|
50
52
|
export interface IAnalyticalDesignerEmbeddedProps {
|
|
51
53
|
/** Route configuration: which insight, which flow, which UI actions. Changes navigate AD. */
|
|
52
54
|
config: IAdEmbeddedRouteConfig;
|
|
53
55
|
/** Mount-scoped host context (workspace, bootstrap data, auth, feature flags). */
|
|
54
56
|
host: IAdEmbeddedHostContext;
|
|
55
|
-
callbacks?:
|
|
57
|
+
callbacks?: AdEmbeddedCallbacks;
|
|
56
58
|
apiRef?: Ref<IAdEmbeddedApi>;
|
|
57
59
|
/** Regions the host replaces or wraps. */
|
|
58
60
|
slots?: IAnalyticalDesignerSlots;
|
|
@@ -68,4 +70,5 @@ export interface IAnalyticalDesignerEmbeddedProps {
|
|
|
68
70
|
* store, reinitialize backend, start sagas; unmount cancels the saga task and resets the store.
|
|
69
71
|
*/
|
|
70
72
|
export declare function AnalyticalDesignerEmbedded({ config, host, callbacks, apiRef, slots, }: IAnalyticalDesignerEmbeddedProps): ReactElement | null;
|
|
73
|
+
export {};
|
|
71
74
|
//# sourceMappingURL=AnalyticalDesignerEmbedded.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticalDesignerEmbedded.d.ts","sourceRoot":"","sources":["../../src/embedding/AnalyticalDesignerEmbedded.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,GAAG,EAMX,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAIH,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAE7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,KAAK,cAAc,EAA4B,MAAM,mCAAmC,CAAC;AAMlG,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAkC,MAAM,eAAe,CAAC;AAGpG,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAShF,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"AnalyticalDesignerEmbedded.d.ts","sourceRoot":"","sources":["../../src/embedding/AnalyticalDesignerEmbedded.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,GAAG,EAMX,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAIH,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAE7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,KAAK,cAAc,EAA4B,MAAM,mCAAmC,CAAC;AAMlG,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAkC,MAAM,eAAe,CAAC;AAGpG,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAShF,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,KAAK,sBAAsB,EAAqB,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,KAAK,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AAY7E,OAAO,EAAmB,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAG5E;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,YAAY,CAAC,EAAE,sBAAsB,GAAG,aAAa,CAAC;IACtD,oBAAoB,CAAC,EAAE,qBAAqB,CAAC;IAC7C;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,WAAW,EAAE,cAAc,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,uBAAuB,CAAC;IAC7C,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC3B,gEAAgE;IAChE,WAAW,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC/C,KAAK,IAAI,IAAI,CAAC;IACd,mBAAmB,IAAI,IAAI,CAAC;IAC5B,gBAAgB,CAAC,IAAI,EAAE,qBAAqB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxE,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC/C;AAED,sEAAsE;AACtE,KAAK,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;AAEjF,MAAM,WAAW,gCAAgC;IAC7C,6FAA6F;IAC7F,MAAM,EAAE,sBAAsB,CAAC;IAC/B,kFAAkF;IAClF,IAAI,EAAE,sBAAsB,CAAC;IAC7B,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,MAAM,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC7B,0CAA0C;IAC1C,KAAK,CAAC,EAAE,wBAAwB,CAAC;CACpC;AAuBD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,EACvC,MAAM,EACN,IAAI,EACJ,SAAS,EACT,MAAM,EACN,KAAK,GACR,EAAE,gCAAgC,GAAG,YAAY,GAAG,IAAI,CA8IxD"}
|
|
@@ -16,7 +16,6 @@ import { getErrorsState } from "../store/app_context/app_context_selectors.js";
|
|
|
16
16
|
import { storeApiToken } from "../store/application_context/app_context_actions.js";
|
|
17
17
|
import { setRouteProjectId } from "../store/router/router_actions.js";
|
|
18
18
|
import { buildEmbeddedHash } from "./buildEmbeddedHash.js";
|
|
19
|
-
import { deliverEventToCallbacks } from "./embeddedCallbacks.js";
|
|
20
19
|
import { installHostAdapter } from "./hostBridge.js";
|
|
21
20
|
import { activateHostCommandOwner, deactivateHostCommandOwner, } from "./hostCommandGate.js";
|
|
22
21
|
import { sendCommandToAd } from "./hostCommands.js";
|
|
@@ -84,7 +83,7 @@ export function AnalyticalDesignerEmbedded({ config, host, callbacks, apiRef, sl
|
|
|
84
83
|
// only a body-level marker can.
|
|
85
84
|
document.body.classList.add("gd-ad-embedded");
|
|
86
85
|
const uninstallAdapter = installHostAdapter({
|
|
87
|
-
onEvent: (event) =>
|
|
86
|
+
onEvent: (event) => callbacksRef.current?.onEvent?.(event),
|
|
88
87
|
});
|
|
89
88
|
// setHostedComponentMode(true): differentiates the router choice and postMessage registration.
|
|
90
89
|
store.dispatch(setHostedComponentMode(true));
|
|
@@ -3,7 +3,6 @@ import { type IInsight, type ITheme, type ObjRef } from "@gooddata/sdk-model";
|
|
|
3
3
|
import { type IBootstrapData } from "../actions/app_context_actions.js";
|
|
4
4
|
import { type IAnalyticalDesignerConfig, type IAnalyticalDesignerProps } from "./analyticalDesignerTypes.js";
|
|
5
5
|
import { type IAdEmbeddedRouteConfig } from "./buildEmbeddedHash.js";
|
|
6
|
-
import { type IAdEmbeddedCallbacks } from "./embeddedCallbacks.js";
|
|
7
6
|
/** The identifiers AD builds its route from, resolved from the identifiers and refs of the props. */
|
|
8
7
|
export interface IResolvedRouteIdentifiers {
|
|
9
8
|
insightId?: string;
|
|
@@ -27,9 +26,4 @@ export declare function toRouteConfig(identifiers: IResolvedRouteIdentifiers, co
|
|
|
27
26
|
export declare function resolveTheme({ theme, disableThemeLoading, themeModifier }: IAnalyticalDesignerProps, loadedTheme: ITheme | undefined): ITheme | undefined;
|
|
28
27
|
/** AD's bootstrap data loaded from the backend, with the values the config provides applied on top. */
|
|
29
28
|
export declare function applyConfigToBootstrapData(data: IBootstrapData, config: IAnalyticalDesignerConfig, theme: ITheme | undefined): IBootstrapData;
|
|
30
|
-
/**
|
|
31
|
-
* The callbacks AD delivers its events to: the typed callbacks of the props, then the catch-all, the
|
|
32
|
-
* event handlers and onMetricsChanged, which has no typed event of its own.
|
|
33
|
-
*/
|
|
34
|
-
export declare function toEmbeddedCallbacks(props: IAnalyticalDesignerProps): IAdEmbeddedCallbacks;
|
|
35
29
|
//# sourceMappingURL=analyticalDesignerConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyticalDesignerConfig.d.ts","sourceRoot":"","sources":["../../src/embedding/analyticalDesignerConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,MAAM,EAKd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"analyticalDesignerConfig.d.ts","sourceRoot":"","sources":["../../src/embedding/analyticalDesignerConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,MAAM,EAKd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,EAAE,KAAK,yBAAyB,EAAE,KAAK,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7G,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,qGAAqG;AACrG,MAAM,WAAW,yBAAyB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,8FAA8F;AAC9F,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAWrF;AAED,0EAA0E;AAC1E,wBAAsB,wBAAwB,CAC1C,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAC/C,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAe7B;AAED,wGAAwG;AACxG,wBAAsB,0BAA0B,CAC5C,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GACpC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAY7B;AAED,yDAAyD;AACzD,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,EAC5C,MAAM,EAAE,yBAAyB,GAClC,OAAO,CAAC,yBAAyB,CAAC,CAOpC;AAED,8FAA8F;AAC9F,wBAAgB,aAAa,CACzB,WAAW,EAAE,yBAAyB,EACtC,MAAM,EAAE,yBAAyB,GAClC,sBAAsB,CAexB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CACxB,EAAE,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,EAAE,wBAAwB,EACvE,WAAW,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,GAAG,SAAS,CAGpB;AAED,uGAAuG;AACvG,wBAAgB,0BAA0B,CACtC,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,yBAAyB,EACjC,KAAK,EAAE,MAAM,GAAG,SAAS,GAC1B,cAAc,CAwBhB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
import { insightId, isIdentifierRef, isUriRef, objRefToString, } from "@gooddata/sdk-model";
|
|
3
|
-
import { METRICS_CHANGED_EVENT } from "../postMessageApi/outgoing/metrics_changed_events.js";
|
|
4
3
|
/** A stable key of an insight, ref or identifier, for comparing the props between renders. */
|
|
5
4
|
export function routeTargetKey(target) {
|
|
6
5
|
if (target === undefined) {
|
|
@@ -105,38 +104,3 @@ export function applyConfigToBootstrapData(data, config, theme) {
|
|
|
105
104
|
},
|
|
106
105
|
};
|
|
107
106
|
}
|
|
108
|
-
/**
|
|
109
|
-
* The callbacks AD delivers its events to: the typed callbacks of the props, then the catch-all, the
|
|
110
|
-
* event handlers and onMetricsChanged, which has no typed event of its own.
|
|
111
|
-
*/
|
|
112
|
-
export function toEmbeddedCallbacks(props) {
|
|
113
|
-
return {
|
|
114
|
-
onInsightSaved: (data, contextId) => props.onInsightSaved?.(data, contextId),
|
|
115
|
-
onInsightEditingCancelled: () => props.onInsightEditingCancelled?.(),
|
|
116
|
-
onInsightOpened: (data) => props.onInsightOpened?.(data),
|
|
117
|
-
onInsightRendered: (data) => props.onInsightRendered?.(data),
|
|
118
|
-
onInsightChanged: (data) => props.onInsightChanged?.(data),
|
|
119
|
-
onClearFinished: (data, contextId) => props.onClearFinished?.(data, contextId),
|
|
120
|
-
onClearInsightFinished: (data, contextId) => props.onClearInsightFinished?.(data, contextId),
|
|
121
|
-
onUndoFinished: (data, contextId) => props.onUndoFinished?.(data, contextId),
|
|
122
|
-
onRedoFinished: (data, contextId) => props.onRedoFinished?.(data, contextId),
|
|
123
|
-
onExportFinished: (data, contextId) => props.onExportFinished?.(data, contextId),
|
|
124
|
-
onFilterContextChanged: (data) => props.onFilterContextChanged?.(data),
|
|
125
|
-
onSetFilterContextFinished: (data, contextId) => props.onSetFilterContextFinished?.(data, contextId),
|
|
126
|
-
onRemoveFilterContextFinished: (data, contextId) => props.onRemoveFilterContextFinished?.(data, contextId),
|
|
127
|
-
onAppCommandFailed: (data, contextId) => props.onCommandFailed?.(data, contextId),
|
|
128
|
-
onAttributeHierarchyModified: () => props.onAttributeHierarchyModified?.(),
|
|
129
|
-
onError: (reason) => props.onError?.(reason),
|
|
130
|
-
onEvent: (event) => {
|
|
131
|
-
props.onEvent?.(event);
|
|
132
|
-
props.eventHandlers?.forEach((eventHandler) => {
|
|
133
|
-
if (eventHandler.eval(event)) {
|
|
134
|
-
eventHandler.handler(event);
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
if (event.name === METRICS_CHANGED_EVENT) {
|
|
138
|
-
props.onMetricsChanged?.();
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
}
|