@gooddata/sdk-ui-ext 11.55.0-alpha.2 → 11.55.0-alpha.4

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.
Files changed (68) hide show
  1. package/NOTICE +9 -9
  2. package/esm/index.d.ts +4 -2
  3. package/esm/index.d.ts.map +1 -1
  4. package/esm/index.js +3 -2
  5. package/esm/internal/components/configurationControls/conditionalFormatting/ConditionEditor.d.ts.map +1 -1
  6. package/esm/internal/components/configurationControls/conditionalFormatting/ConditionEditor.js +8 -5
  7. package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.d.ts +20 -5
  8. package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.d.ts.map +1 -1
  9. package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.js +143 -33
  10. package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.d.ts +19 -1
  11. package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.d.ts.map +1 -1
  12. package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.js +146 -46
  13. package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingModel.d.ts +34 -7
  14. package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingModel.d.ts.map +1 -1
  15. package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingModel.js +38 -7
  16. package/esm/internal/components/configurationPanels/PivotTableConfigurationPanel.d.ts.map +1 -1
  17. package/esm/internal/components/configurationPanels/PivotTableConfigurationPanel.js +9 -4
  18. package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.d.ts.map +1 -1
  19. package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.js +18 -18
  20. package/esm/internal/components/pluggableVisualizations/pivotTableNext/pivotTableNextConfigFromInsight.d.ts +1 -2
  21. package/esm/internal/components/pluggableVisualizations/pivotTableNext/pivotTableNextConfigFromInsight.d.ts.map +1 -1
  22. package/esm/internal/components/pluggableVisualizations/pivotTableNext/pivotTableNextConfigFromInsight.js +3 -9
  23. package/esm/internal/index.d.ts +1 -0
  24. package/esm/internal/index.d.ts.map +1 -1
  25. package/esm/internal/index.js +1 -0
  26. package/esm/internal/translations/de-DE.localization-bundle.js +2 -2
  27. package/esm/internal/translations/en-US.localization-bundle.d.ts +14 -2
  28. package/esm/internal/translations/en-US.localization-bundle.d.ts.map +1 -1
  29. package/esm/internal/translations/en-US.localization-bundle.js +18 -6
  30. package/esm/internal/translations/zh-HK.localization-bundle.js +40 -40
  31. package/esm/internal/translations/zh-Hant.localization-bundle.js +1 -1
  32. package/esm/internal/utils/embeddingInsightViewCodeGenerator/insightViewConfig.d.ts.map +1 -1
  33. package/esm/internal/utils/embeddingInsightViewCodeGenerator/insightViewConfig.js +2 -1
  34. package/esm/internal/utils/propertiesHelper.d.ts +33 -1
  35. package/esm/internal/utils/propertiesHelper.d.ts.map +1 -1
  36. package/esm/internal/utils/propertiesHelper.js +43 -1
  37. package/esm/locales.d.ts +11 -2
  38. package/esm/locales.d.ts.map +1 -1
  39. package/esm/locales.js +5 -2
  40. package/esm/sdk-ui-ext.d.ts +194 -4
  41. package/esm/share/ObjectShareDialog.d.ts +19 -0
  42. package/esm/share/ObjectShareDialog.d.ts.map +1 -1
  43. package/esm/share/ObjectShareDialog.js +8 -1
  44. package/esm/share/objectShareController.helpers.d.ts +8 -52
  45. package/esm/share/objectShareController.helpers.d.ts.map +1 -1
  46. package/esm/share/objectShareController.helpers.js +23 -0
  47. package/esm/share/objectShareController.types.d.ts +76 -3
  48. package/esm/share/objectShareController.types.d.ts.map +1 -1
  49. package/esm/share/useAccessList.d.ts +14 -3
  50. package/esm/share/useAccessList.d.ts.map +1 -1
  51. package/esm/share/useAccessList.js +26 -7
  52. package/esm/share/useApplyObjectPermissions.d.ts +13 -0
  53. package/esm/share/useApplyObjectPermissions.d.ts.map +1 -0
  54. package/esm/share/useApplyObjectPermissions.js +33 -0
  55. package/esm/share/useObjectShareController.d.ts.map +1 -1
  56. package/esm/share/useObjectShareController.js +20 -9
  57. package/esm/share/useObjectShareDialog.d.ts +12 -3
  58. package/esm/share/useObjectShareDialog.d.ts.map +1 -1
  59. package/esm/share/useObjectShareDialog.js +16 -3
  60. package/package.json +23 -24
  61. package/styles/css/main.css +65 -4
  62. package/styles/css/main.css.map +1 -1
  63. package/styles/internal/css/conditional_formatting.css +38 -4
  64. package/styles/internal/css/conditional_formatting.css.map +1 -1
  65. package/styles/internal/css/insightPicker.css +27 -0
  66. package/styles/internal/css/insightPicker.css.map +1 -1
  67. package/styles/internal/scss/conditional_formatting.scss +67 -18
  68. package/styles/internal/scss/insightPicker.scss +41 -0
@@ -21,7 +21,7 @@ import { DateFilterGranularity } from '@gooddata/sdk-model';
21
21
  import { Dispatch } from 'react';
22
22
  import { EmbedType } from '@gooddata/sdk-ui-kit';
23
23
  import { ExplicitDrill } from '@gooddata/sdk-ui';
24
- import type { GeneralAccessValue } from '@gooddata/sdk-ui-kit';
24
+ import { GeneralAccessValue } from '@gooddata/sdk-ui-kit';
25
25
  import { GoodDataSdkError } from '@gooddata/sdk-ui';
26
26
  import { IAlertComparisonOperator } from '@gooddata/sdk-model';
27
27
  import { IAlertRelativeArithmeticOperator } from '@gooddata/sdk-model';
@@ -31,6 +31,7 @@ import { IAutomationMetadataObject } from '@gooddata/sdk-model';
31
31
  import { ICatalogAttributeHierarchy } from '@gooddata/sdk-model';
32
32
  import { IChartConfig } from '@gooddata/sdk-ui-charts';
33
33
  import { IColorPalette } from '@gooddata/sdk-model';
34
+ import { IConditionalFormatting } from '@gooddata/sdk-model';
34
35
  import { IConditionalFormattingRule } from '@gooddata/sdk-ui-pivot/next';
35
36
  import { IDashboardUrlBuilder } from '@gooddata/sdk-ui';
36
37
  import { IDateFilterOptionsByType } from '@gooddata/sdk-ui-filters';
@@ -50,6 +51,7 @@ import { IntlShape } from 'react-intl';
50
51
  import type { IObjectAccessList } from '@gooddata/sdk-model';
51
52
  import type { IObjectPermissionsObject } from '@gooddata/sdk-backend-spi';
52
53
  import { IPivotTableConfig } from '@gooddata/sdk-ui-pivot';
54
+ import { ISemanticConditionalFormatting } from '@gooddata/sdk-model';
53
55
  import { ISeparators } from '@gooddata/sdk-model';
54
56
  import { ISettings } from '@gooddata/sdk-model';
55
57
  import { ITab } from '@gooddata/sdk-ui-kit';
@@ -276,7 +278,7 @@ export declare const COMPARISON_OPERATORS: {
276
278
  /**
277
279
  * @internal
278
280
  */
279
- export declare function ConditionalFormattingDialog({ rule: initialRule, isNew, targetOptions, separators, dateFilterOptions, dateSettings, alignTo, readOnly, fixedTarget, onSave, onClose }: IConditionalFormattingDialogProps): JSX.Element;
281
+ export declare function ConditionalFormattingDialog({ rule: initialRule, isNew, targetOptions, separators, dateFilterOptions, dateSettings, alignTo, fixedTarget, semanticByTarget, onDelete, onRevertToDefault, onSave, onClose }: IConditionalFormattingDialogProps): JSX.Element;
280
282
 
281
283
  /**
282
284
  * @internal
@@ -427,6 +429,17 @@ export declare const fluidLayoutDescriptor: FluidLayoutDescriptor;
427
429
  */
428
430
  export declare const getComparisonOperatorTitle: (operator: IAlertComparisonOperator, intl: IntlShape) => string;
429
431
 
432
+ /**
433
+ * The conditional formatting config that should currently apply to an insight: gated behind the
434
+ * feature flag and behind the insight actually being a next-gen pivot table (disabled/not-a-pivot-
435
+ * table means no config at all, so there is no UI to edit rules a viewer can't see take effect, and
436
+ * a chart/geo export never picks up stale CF left over from a since-changed visualization type),
437
+ * preferring a runtime override (e.g. InsightView's config prop) over the insight's own saved rules.
438
+ *
439
+ * @internal
440
+ */
441
+ export declare function getEffectiveConditionalFormatting(insight: IInsightDefinition, settings: ISettings | undefined, configOverride?: IConditionalFormatting): IConditionalFormatting | undefined;
442
+
430
443
  /**
431
444
  * @internal
432
445
  */
@@ -447,6 +460,43 @@ export declare function getInsightWithAppliedDrillDown(insight: IInsight, drillE
447
460
  */
448
461
  export declare const getRelativeOperatorTitle: (operator: IAlertRelativeOperator, art: IAlertRelativeArithmeticOperator, intl: IntlShape) => string;
449
462
 
463
+ /**
464
+ * A transient edit overlaid on a fetched grantee row (keyed by grantee id in
465
+ * `mergeGrantees`). The pending-guard keeps at most one edit in flight per id.
466
+ * A pending edit that superseded an already-COMMITTED entry (an added row, an
467
+ * earlier level change) carries it as `settled`, because the fetched base no longer
468
+ * holds that row's last-settled state: failure restores `settled`, success drops it.
469
+ * With no `settled`, failure deletes the entry, reverting to the fetched row.
470
+ *
471
+ * @internal
472
+ */
473
+ export declare type GranteeEdit = {
474
+ kind: "level";
475
+ level: ObjectSharePermissionLevel;
476
+ pending: boolean;
477
+ settled?: GranteeEdit;
478
+ } | {
479
+ kind: "added";
480
+ grantee: IObjectShareGrantee;
481
+ pending: boolean;
482
+ settled?: GranteeEdit;
483
+ } | {
484
+ kind: "removed";
485
+ pending: boolean;
486
+ settled?: GranteeEdit;
487
+ }
488
+ /**
489
+ * Pending marker only — the row renders exactly as it stands. For a write that
490
+ * locks the row without changing its access (a label-scope edit), so nothing has
491
+ * to invent a level: reusing the `level` overlay would record the DISPLAYED level
492
+ * as the direct grant, and that level is the effective one.
493
+ */
494
+ | {
495
+ kind: "locked";
496
+ pending: boolean;
497
+ settled?: GranteeEdit;
498
+ };
499
+
450
500
  /**
451
501
  * @internal
452
502
  */
@@ -602,10 +652,25 @@ export declare interface IConditionalFormattingDialogProps {
602
652
  dateSettings?: ICfDateSettings;
603
653
  /** CSS selector of a small, stable element the popover anchors to. */
604
654
  alignTo: string;
605
- /** Renders the dialog non-interactively: no target picker, no editing, no Save button. */
606
- readOnly?: boolean;
607
655
  /** Renders a static "icon + title" header for the rule's target instead of the picker dropdown. */
608
656
  fixedTarget?: boolean;
657
+ /**
658
+ * Semantic-layer rules by target localId. When the current target has an entry, the dialog
659
+ * offers the "Use default rule" checkbox switching between the inherited rule (locked) and an
660
+ * authored override (editable) — the whole map (not one resolved value) so an untargeted "Add
661
+ * rule" flow re-derives the right fallback if the user changes target mid-dialog.
662
+ */
663
+ semanticByTarget?: Record<string, ISemanticConditionalFormatting>;
664
+ /** Deletes THIS specific authored rule (wired only when one exists) — the trash button. */
665
+ onDelete?: () => void;
666
+ /**
667
+ * Reverts to Inherited: clears every authored rule for `target` (a target can have several
668
+ * stacked custom rules, not just this one) AND this rule's own original id — needed together
669
+ * because a non-fixedTarget dialog lets the user retarget before saving, so the rule being
670
+ * edited may not (yet) be one of the rules actually stored against `target`. Distinct from
671
+ * `onDelete`: triggered only by Save while "Use default rule" is checked.
672
+ */
673
+ onRevertToDefault?: (target: ConditionalFormattingTarget, ruleId: string) => void;
609
674
  onSave: (rule: IConditionalFormattingRule) => void;
610
675
  onClose: () => void;
611
676
  }
@@ -747,6 +812,19 @@ export declare interface IGrantedDataSource {
747
812
  accessSource?: DataSourceAccessSource;
748
813
  }
749
814
 
815
+ /**
816
+ * Known identity facts of a grantee: real name/email only, never an id fallback.
817
+ * Undefined fields are unknown and may be backfilled.
818
+ *
819
+ * @internal
820
+ */
821
+ export declare interface IGranteeIdentityFacts {
822
+ /** Real full name (users) / group name, when known. */
823
+ name?: string;
824
+ /** Real email, when known (users only). */
825
+ email?: string;
826
+ }
827
+
750
828
  /**
751
829
  * @internal
752
830
  */
@@ -1547,6 +1625,23 @@ export declare interface IObjectShareDialogProps {
1547
1625
  * keep an inline access row in sync without refetching.
1548
1626
  */
1549
1627
  onSummaryChange?: (summary: IObjectAccessSummary) => void;
1628
+ /**
1629
+ * Manage access for an object that does not exist yet. Nothing is written; the result
1630
+ * arrives through `onDraftChange`. Requires no `target`, and `labels` is ignored.
1631
+ */
1632
+ draft?: boolean;
1633
+ /**
1634
+ * Fires with the final draft as the dialog closes, while `draft`. Required: the session
1635
+ * unmounts on close, so a draft nobody keeps is lost.
1636
+ */
1637
+ onDraftChange?: (draft: IObjectShareDraft) => void;
1638
+ /** Draft to carry on from, when reopening. */
1639
+ initialDraft?: IObjectShareDraft;
1640
+ /**
1641
+ * What a draft's general access starts as; an untouched default is never written.
1642
+ * Defaults to RESTRICTED; pass WORKSPACE for a type the backend creates visible.
1643
+ */
1644
+ initialDraftGeneralAccess?: GeneralAccessValue;
1550
1645
  /**
1551
1646
  * Labels (display forms) of the shared attribute, enabling the per-grantee
1552
1647
  * label-scope picker. Omit for objects without labels (e.g. facts).
@@ -1568,6 +1663,67 @@ export declare interface IObjectShareDialogProps {
1568
1663
  labelsError?: boolean;
1569
1664
  }
1570
1665
 
1666
+ /**
1667
+ * Unsaved access for an object that does not exist yet.
1668
+ *
1669
+ * @internal
1670
+ */
1671
+ export declare interface IObjectShareDraft {
1672
+ granteeEdits: Readonly<Record<string, GranteeEdit>>;
1673
+ ruleEdit: IRuleEdit | undefined;
1674
+ }
1675
+
1676
+ /**
1677
+ * Dialog row derived from a backend grant. `name`/`email` are real facts only;
1678
+ * display fallbacks are `granteeDisplayPair`'s concern.
1679
+ *
1680
+ * @internal
1681
+ */
1682
+ export declare interface IObjectShareGrantee extends IGranteeIdentityFacts {
1683
+ /** Stable id used as the dialog row's React key. `user:<ref>` / `group:<ref>`. */
1684
+ id: string;
1685
+ kind: "user" | "group";
1686
+ granteeRef: ObjRef;
1687
+ /**
1688
+ * Whether this row is the signed-in user's own grant. Derived from the
1689
+ * profile, so it holds for rows of any origin (fetched or optimistic).
1690
+ */
1691
+ isSelf?: boolean;
1692
+ /**
1693
+ * EFFECTIVE permission level shown on the row — the stronger of {@link IObjectShareGrantee.directLevel}
1694
+ * and {@link IObjectShareGrantee.inheritedLevel}, so a grantee who only inherits a level is not
1695
+ * understated as VIEW.
1696
+ */
1697
+ level: ObjectSharePermissionLevel;
1698
+ /**
1699
+ * Permission level granted by THIS workspace, or undefined when the grantee's
1700
+ * access is inherited-only (a group, or a parent workspace in a hierarchy).
1701
+ * This — not {@link IObjectShareGrantee.level} — is what a re-grade writes and what decides whether
1702
+ * there is a grant here to remove: inherited access cannot be revoked from here.
1703
+ */
1704
+ directLevel?: ObjectSharePermissionLevel;
1705
+ /**
1706
+ * Inherited permission to surface as a warning: set when inheritance carries the
1707
+ * grantee above their direct grant (including inherited-only, where the whole
1708
+ * displayed level is inherited). Undefined when the direct grant already covers
1709
+ * the effective permission. Drives the row's warning badge.
1710
+ */
1711
+ effectivePermission?: ObjectSharePermissionLevel;
1712
+ /**
1713
+ * Strongest permission the grantee inherits (via a group, or a parent workspace),
1714
+ * regardless of the current direct level. Retained from the fetch so the
1715
+ * displayed level and badge can be recomposed locally when the direct level
1716
+ * changes (no refetch).
1717
+ */
1718
+ inheritedLevel?: ObjectSharePermissionLevel;
1719
+ /**
1720
+ * Row-level in-flight state for optimistic updates: `"saving"` while a level
1721
+ * change or freshly-added grant is being committed, `"removing"` while a
1722
+ * removal is in flight. Undefined when the row reflects committed state.
1723
+ */
1724
+ pending?: "saving" | "removing";
1725
+ }
1726
+
1571
1727
  /**
1572
1728
  * A label (attribute display form) of the shared attribute. The share dialog
1573
1729
  * scopes a grantee's access to a subset of these via per-label permission grants.
@@ -1593,6 +1749,21 @@ export declare interface IObjectShareLabel {
1593
1749
  isDefault: boolean;
1594
1750
  }
1595
1751
 
1752
+ /**
1753
+ * Transient edit of the all-workspace-users rule (general access + its level),
1754
+ * overlaid on the fetched rule state in the hook. Same lifecycle and `settled`
1755
+ * semantics as {@link GranteeEdit}, one edit in flight at a time.
1756
+ *
1757
+ * @internal
1758
+ */
1759
+ export declare interface IRuleEdit {
1760
+ generalAccess: GeneralAccessValue;
1761
+ level: ObjectSharePermissionLevel;
1762
+ pending: boolean;
1763
+ /** The committed rule edit this pending one superseded; restored on failure. */
1764
+ settled?: IRuleEdit;
1765
+ }
1766
+
1596
1767
  /**
1597
1768
  * Type-guard testing whether the provided object is an instance of {@link IDrillDownDefinition}.
1598
1769
  * @beta
@@ -1891,6 +2062,14 @@ export declare function NotificationsPanel(props: INotificationsPanelProps): JSX
1891
2062
  */
1892
2063
  export declare function ObjectShareDialog(props: IObjectShareDialogProps): JSX.Element | null;
1893
2064
 
2065
+ /**
2066
+ * Permission level surfaced in the share dialog — the model's granular access
2067
+ * permission (VIEW / SHARE / EDIT), assignable from the permission menu.
2068
+ *
2069
+ * @internal
2070
+ */
2071
+ export declare type ObjectSharePermissionLevel = AccessGranularPermission;
2072
+
1894
2073
  /**
1895
2074
  * @alpha
1896
2075
  */
@@ -1972,6 +2151,17 @@ export declare type TelemetryEvent = "multiple-users-deleted" | "multiple-groups
1972
2151
  */
1973
2152
  export declare type TrackEventCallback = (event: TelemetryEvent) => void;
1974
2153
 
2154
+ /**
2155
+ * Writes a draft's access to an object that now exists.
2156
+ *
2157
+ * @remarks
2158
+ * One request, so it all lands or none does. True when it landed or asked for nothing,
2159
+ * false when it failed — nothing is shown to the user.
2160
+ *
2161
+ * @internal
2162
+ */
2163
+ export declare function useApplyObjectPermissions(): (target: IObjectPermissionsObject, draft: IObjectShareDraft) => Promise<boolean>;
2164
+
1975
2165
  /**
1976
2166
  * The workspace date-filter preset catalog for date-condition value pickers — the same catalog the
1977
2167
  * dashboard date filter consumes. Undefined while loading (the picker degrades to its static form);
@@ -1,4 +1,6 @@
1
1
  import type { IObjectPermissionsObject } from "@gooddata/sdk-backend-spi";
2
+ import { type GeneralAccessValue } from "@gooddata/sdk-ui-kit";
3
+ import type { IObjectShareDraft } from "./objectShareController.types.js";
2
4
  import type { IObjectAccessSummary, IObjectShareLabel } from "./types.js";
3
5
  /**
4
6
  * Props for {@link ObjectShareDialog}.
@@ -24,6 +26,23 @@ export interface IObjectShareDialogProps {
24
26
  * keep an inline access row in sync without refetching.
25
27
  */
26
28
  onSummaryChange?: (summary: IObjectAccessSummary) => void;
29
+ /**
30
+ * Manage access for an object that does not exist yet. Nothing is written; the result
31
+ * arrives through `onDraftChange`. Requires no `target`, and `labels` is ignored.
32
+ */
33
+ draft?: boolean;
34
+ /**
35
+ * Fires with the final draft as the dialog closes, while `draft`. Required: the session
36
+ * unmounts on close, so a draft nobody keeps is lost.
37
+ */
38
+ onDraftChange?: (draft: IObjectShareDraft) => void;
39
+ /** Draft to carry on from, when reopening. */
40
+ initialDraft?: IObjectShareDraft;
41
+ /**
42
+ * What a draft's general access starts as; an untouched default is never written.
43
+ * Defaults to RESTRICTED; pass WORKSPACE for a type the backend creates visible.
44
+ */
45
+ initialDraftGeneralAccess?: GeneralAccessValue;
27
46
  /**
28
47
  * Labels (display forms) of the shared attribute, enabling the per-grantee
29
48
  * label-scope picker. Omit for objects without labels (e.g. facts).
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectShareDialog.d.ts","sourceRoot":"","sources":["../../src/share/ObjectShareDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAc1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA0C1E;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC,gDAAgD;IAChD,MAAM,EAAE,wBAAwB,GAAG,SAAS,CAAC;IAC7C,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,sFAAsF;IACtF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,uBAAuB,kDAK/D"}
1
+ {"version":3,"file":"ObjectShareDialog.d.ts","sourceRoot":"","sources":["../../src/share/ObjectShareDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EACH,KAAK,kBAAkB,EAQ1B,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EACR,iBAAiB,EAGpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA0C1E;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC,gDAAgD;IAChD,MAAM,EAAE,wBAAwB,GAAG,SAAS,CAAC;IAC7C,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,sFAAsF;IACtF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACnD,8CAA8C;IAC9C,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC;;;OAGG;IACH,yBAAyB,CAAC,EAAE,kBAAkB,CAAC;IAC/C;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,uBAAuB,kDAa/D"}
@@ -1,6 +1,7 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2026 GoodData Corporation
3
3
  import { useIntl } from "react-intl";
4
+ import { invariant } from "ts-invariant";
4
5
  import { UiAddGranteeDialog, UiConfirmDialog, UiGranteeRowControls, UiObjectShareDialog, UiTag, UiTooltip, } from "@gooddata/sdk-ui-kit";
5
6
  import { objectShareMessages } from "./messages.js";
6
7
  import { granteeDisplayPair } from "./objectShareController.helpers.js";
@@ -40,13 +41,15 @@ function AdminSelfTag() {
40
41
  * @internal
41
42
  */
42
43
  export function ObjectShareDialog(props) {
44
+ invariant(!props.draft || !props.target, "ObjectShareDialog: `draft` cannot be combined with a `target` — a draft is for an object that does not exist yet, and nothing it stages would ever be written to that target.");
45
+ invariant(!props.draft || props.onDraftChange, "ObjectShareDialog: `draft` requires `onDraftChange`, and something above the dialog must keep what it emits and pass it back as `initialDraft` — the session unmounts on close, discarding anything only drafted.");
43
46
  if (!props.isOpen) {
44
47
  return null;
45
48
  }
46
49
  return _jsx(ObjectShareDialogSession, { ...props });
47
50
  }
48
51
  /** The dialog session — mounted only while open, so its state cannot outlive a close. */
49
- function ObjectShareDialogSession({ target, objectTitle, onClose, onSummaryChange, labels, labelsLoading, labelsError, }) {
52
+ function ObjectShareDialogSession({ target, objectTitle, onClose, onSummaryChange, labels, labelsLoading, labelsError, draft, onDraftChange, initialDraft, initialDraftGeneralAccess, }) {
50
53
  const intl = useIntl();
51
54
  const { state, actions, isShareViewOpen, isAddGranteeOpen, isGeneralAccessConfirmOpen, isSelfRestrictConfirmOpen, isMutable, isLoading, workspaceDisabledLevels, grantableDisabledLevels, grantLimitTooltip, rowDisabledLevels, rowDisabledLevelTooltips, isRowRemoveDisabled, isRowControlsLocked, rowRemoveDisabledTooltip, onClose: closeDialog, onRowPermissionChange, onRowRemove, onSelfRestrictCancel, onSelfRestrictConfirm, } = useObjectShareDialog({
52
55
  target,
@@ -55,6 +58,10 @@ function ObjectShareDialogSession({ target, objectTitle, onClose, onSummaryChang
55
58
  labels,
56
59
  labelsLoading,
57
60
  labelsError,
61
+ draft,
62
+ onDraftChange,
63
+ initialDraft,
64
+ initialDraftGeneralAccess,
58
65
  });
59
66
  // Primary label is locked — always selected, can't be unchecked.
60
67
  const labelItems = state.labels.map((l) => ({
@@ -1,6 +1,5 @@
1
1
  import { type IAvailableAccessGrantee, type IGranularAccessGrantee, type IObjectAccessList, type ObjRef } from "@gooddata/sdk-model";
2
- import type { GeneralAccessValue } from "@gooddata/sdk-ui-kit";
3
- import type { IGranteeIdentityFacts, IObjectShareGrantee, ISelfIdentity, ObjectSharePermissionLevel } from "./objectShareController.types.js";
2
+ import type { GranteeEdit, IGranteeIdentityFacts, IObjectShareDraft, IObjectShareGrantee, ISelfIdentity, ObjectSharePermissionLevel } from "./objectShareController.types.js";
4
3
  import type { IObjectShareLabel } from "./types.js";
5
4
  /** Stable row id shared by grantee rows and picker options: `user:<ref>` / `group:<ref>`. */
6
5
  export declare function granteeId(kind: "user" | "group", ref: ObjRef): string;
@@ -117,56 +116,6 @@ export declare function withDirectLevel(grantee: IObjectShareGrantee, direct: Ob
117
116
  */
118
117
  export declare function withoutDirectGrant(grantee: IObjectShareGrantee, inheritedLevel: ObjectSharePermissionLevel): IObjectShareGrantee;
119
118
  export declare function granteesFromAccessList(list: IObjectAccessList | undefined): IObjectShareGrantee[];
120
- /**
121
- * A transient edit overlaid on a fetched grantee row (keyed by grantee id in
122
- * {@link mergeGrantees}). The pending-guard keeps at most one edit in flight per id.
123
- * A pending edit that superseded an already-COMMITTED entry (an added row, an
124
- * earlier level change) carries it as `settled`, because the fetched base no longer
125
- * holds that row's last-settled state: failure restores `settled`, success drops it.
126
- * With no `settled`, failure deletes the entry, reverting to the fetched row.
127
- *
128
- * @internal
129
- */
130
- export type GranteeEdit = {
131
- kind: "level";
132
- level: ObjectSharePermissionLevel;
133
- pending: boolean;
134
- settled?: GranteeEdit;
135
- } | {
136
- kind: "added";
137
- grantee: IObjectShareGrantee;
138
- pending: boolean;
139
- settled?: GranteeEdit;
140
- } | {
141
- kind: "removed";
142
- pending: boolean;
143
- settled?: GranteeEdit;
144
- }
145
- /**
146
- * Pending marker only — the row renders exactly as it stands. For a write that
147
- * locks the row without changing its access (a label-scope edit), so nothing has
148
- * to invent a level: reusing the `level` overlay would record the DISPLAYED level
149
- * as the direct grant, and that level is the effective one.
150
- */
151
- | {
152
- kind: "locked";
153
- pending: boolean;
154
- settled?: GranteeEdit;
155
- };
156
- /**
157
- * Transient edit of the all-workspace-users rule (general access + its level),
158
- * overlaid on the fetched rule state in the hook. Same lifecycle and `settled`
159
- * semantics as {@link GranteeEdit}, one edit in flight at a time.
160
- *
161
- * @internal
162
- */
163
- export interface IRuleEdit {
164
- generalAccess: GeneralAccessValue;
165
- level: ObjectSharePermissionLevel;
166
- pending: boolean;
167
- /** The committed rule edit this pending one superseded; restored on failure. */
168
- settled?: IRuleEdit;
169
- }
170
119
  /**
171
120
  * Pure composition of the fetched base with the transient overlay — the hook's
172
121
  * `grantees` derive from this with no effect and no mirrored state. Marks the
@@ -247,6 +196,13 @@ export declare function buildLabelMutationsForScopes(changes: readonly ILabelSco
247
196
  ref: ObjRef;
248
197
  grantees: IGranularAccessGrantee[];
249
198
  }>;
199
+ /**
200
+ * The permissions to POST for a draft, once its object exists. Idempotent.
201
+ *
202
+ * Only adds survive: nothing is granted yet, so removals drop out. The creator is left to
203
+ * the backend — a draft that named them could also drop them.
204
+ */
205
+ export declare function draftToPermissions(draft: IObjectShareDraft): IGranularAccessGrantee[];
250
206
  /** Stable empty-labels default so the hook's default arg doesn't churn identities. */
251
207
  export declare const NO_LABELS: IObjectShareLabel[];
252
208
  /** Shared empty id-set for "no labels in scope" diffs. */
@@ -1 +1 @@
1
- {"version":3,"file":"objectShareController.helpers.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,KAAK,EACR,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,0BAA0B,EAC7B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;;GAMG;AACH,wBAAgB,4BAA4B,CACxC,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,MAAM,EAAE,iBAAiB,EAAE,GAC5B,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,sBAAsB,EAAE,CAAA;CAAE,CAAC,CAmBxE;AAED,sFAAsF;AACtF,eAAO,MAAM,SAAS,EAAE,iBAAiB,EAAO,CAAC;AAEjD,0DAA0D;AAC1D,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,MAAM,CAAqB,CAAC;AAEhE;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,iBAAiB,EACvB,EAAE,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAcrD"}
1
+ {"version":3,"file":"objectShareController.helpers.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACR,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,0BAA0B,EAC7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC7B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,KAAK,EAAE,MAAM,GAAG,SAAS,GAC1B,qBAAqB,CAKvB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AAmB,CAAC;IAC/B,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACxC;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CACxC,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,MAAM,EAAE,iBAAiB,EAAE,GAC5B,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,sBAAsB,EAAE,CAAA;CAAE,CAAC,CAmBxE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,sBAAsB,EAAE,CAiBrF;AAED,sFAAsF;AACtF,eAAO,MAAM,SAAS,EAAE,iBAAiB,EAAO,CAAC;AAEjD,0DAA0D;AAC1D,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,MAAM,CAAqB,CAAC;AAEhE;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,iBAAiB,EACvB,EAAE,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAcrD"}
@@ -438,6 +438,29 @@ export function buildLabelMutationsForScopes(changes, labels) {
438
438
  }
439
439
  return Array.from(byLabel.values());
440
440
  }
441
+ /**
442
+ * The permissions to POST for a draft, once its object exists. Idempotent.
443
+ *
444
+ * Only adds survive: nothing is granted yet, so removals drop out. The creator is left to
445
+ * the backend — a draft that named them could also drop them.
446
+ */
447
+ export function draftToPermissions(draft) {
448
+ const permissions = [];
449
+ for (const edit of Object.values(draft.granteeEdits)) {
450
+ // Only `added` can reach here: the other kinds need a fetched row, and there is none.
451
+ if (edit.kind === "added") {
452
+ permissions.push(toGranularGrantee(edit.grantee.kind, edit.grantee.granteeRef, edit.grantee.level));
453
+ }
454
+ }
455
+ const { ruleEdit } = draft;
456
+ if (ruleEdit?.generalAccess === "WORKSPACE") {
457
+ permissions.push(granularGranteeFor({ allWorkspaceUsers: true }, ruleEdit.level));
458
+ }
459
+ else if (ruleEdit?.generalAccess === "RESTRICTED") {
460
+ permissions.push(granularGranteeFor({ allWorkspaceUsers: true }, "none"));
461
+ }
462
+ return permissions;
463
+ }
441
464
  /** Stable empty-labels default so the hook's default arg doesn't churn identities. */
442
465
  export const NO_LABELS = [];
443
466
  /** Shared empty id-set for "no labels in scope" diffs. */
@@ -47,15 +47,15 @@ export interface IObjectShareGrantee extends IGranteeIdentityFacts {
47
47
  */
48
48
  isSelf?: boolean;
49
49
  /**
50
- * EFFECTIVE permission level shown on the row — the stronger of {@link directLevel}
51
- * and {@link inheritedLevel}, so a grantee who only inherits a level is not
50
+ * EFFECTIVE permission level shown on the row — the stronger of {@link IObjectShareGrantee.directLevel}
51
+ * and {@link IObjectShareGrantee.inheritedLevel}, so a grantee who only inherits a level is not
52
52
  * understated as VIEW.
53
53
  */
54
54
  level: ObjectSharePermissionLevel;
55
55
  /**
56
56
  * Permission level granted by THIS workspace, or undefined when the grantee's
57
57
  * access is inherited-only (a group, or a parent workspace in a hierarchy).
58
- * This — not {@link level} — is what a re-grade writes and what decides whether
58
+ * This — not {@link IObjectShareGrantee.level} — is what a re-grade writes and what decides whether
59
59
  * there is a grant here to remove: inherited access cannot be revoked from here.
60
60
  */
61
61
  directLevel?: ObjectSharePermissionLevel;
@@ -245,12 +245,73 @@ export interface IObjectShareControllerActions {
245
245
  */
246
246
  changeWorkspaceLevel: (level: ObjectSharePermissionLevel) => Promise<void>;
247
247
  }
248
+ /**
249
+ * A transient edit overlaid on a fetched grantee row (keyed by grantee id in
250
+ * `mergeGrantees`). The pending-guard keeps at most one edit in flight per id.
251
+ * A pending edit that superseded an already-COMMITTED entry (an added row, an
252
+ * earlier level change) carries it as `settled`, because the fetched base no longer
253
+ * holds that row's last-settled state: failure restores `settled`, success drops it.
254
+ * With no `settled`, failure deletes the entry, reverting to the fetched row.
255
+ *
256
+ * @internal
257
+ */
258
+ export type GranteeEdit = {
259
+ kind: "level";
260
+ level: ObjectSharePermissionLevel;
261
+ pending: boolean;
262
+ settled?: GranteeEdit;
263
+ } | {
264
+ kind: "added";
265
+ grantee: IObjectShareGrantee;
266
+ pending: boolean;
267
+ settled?: GranteeEdit;
268
+ } | {
269
+ kind: "removed";
270
+ pending: boolean;
271
+ settled?: GranteeEdit;
272
+ }
273
+ /**
274
+ * Pending marker only — the row renders exactly as it stands. For a write that
275
+ * locks the row without changing its access (a label-scope edit), so nothing has
276
+ * to invent a level: reusing the `level` overlay would record the DISPLAYED level
277
+ * as the direct grant, and that level is the effective one.
278
+ */
279
+ | {
280
+ kind: "locked";
281
+ pending: boolean;
282
+ settled?: GranteeEdit;
283
+ };
284
+ /**
285
+ * Transient edit of the all-workspace-users rule (general access + its level),
286
+ * overlaid on the fetched rule state in the hook. Same lifecycle and `settled`
287
+ * semantics as {@link GranteeEdit}, one edit in flight at a time.
288
+ *
289
+ * @internal
290
+ */
291
+ export interface IRuleEdit {
292
+ generalAccess: GeneralAccessValue;
293
+ level: ObjectSharePermissionLevel;
294
+ pending: boolean;
295
+ /** The committed rule edit this pending one superseded; restored on failure. */
296
+ settled?: IRuleEdit;
297
+ }
298
+ /**
299
+ * Unsaved access for an object that does not exist yet.
300
+ *
301
+ * @internal
302
+ */
303
+ export interface IObjectShareDraft {
304
+ granteeEdits: Readonly<Record<string, GranteeEdit>>;
305
+ ruleEdit: IRuleEdit | undefined;
306
+ }
248
307
  /**
249
308
  * @internal
250
309
  */
251
310
  export interface IObjectShareController {
252
311
  state: IObjectShareControllerState;
253
312
  actions: IObjectShareControllerActions;
313
+ /** The session's unsaved access. Undefined outside draft mode. */
314
+ draft: IObjectShareDraft | undefined;
254
315
  }
255
316
  /**
256
317
  * Options for {@link useObjectShareController}.
@@ -276,5 +337,17 @@ export interface IUseObjectShareOptions {
276
337
  * the labels aren't passed yet, so an empty list must not read as label-free.
277
338
  */
278
339
  labelsLoading?: boolean;
340
+ /**
341
+ * Manage access for an object that does not exist yet. Nothing is written.
342
+ * Requires no `target`, and `labels` is ignored.
343
+ */
344
+ draft?: boolean;
345
+ /** Draft to carry on from. */
346
+ initialDraft?: IObjectShareDraft;
347
+ /**
348
+ * What a draft's general access starts as; an untouched default is never sent.
349
+ * Defaults to RESTRICTED, understating rather than overstating actual access.
350
+ */
351
+ initialDraftGeneralAccess?: GeneralAccessValue;
279
352
  }
280
353
  //# sourceMappingURL=objectShareController.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"objectShareController.types.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEzG,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,wBAAwB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IACxD,EAAE,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAC9D,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,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,IAAI,CAAC;IAC/D,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,4DAA4D;IAC5D,0BAA0B,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD;;;;;OAKG;IACH,oBAAoB,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9E;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,2BAA2B,CAAC;IACnC,OAAO,EAAE,6BAA6B,CAAC;CAC1C;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B"}
1
+ {"version":3,"file":"objectShareController.types.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEzG,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,wBAAwB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IACxD,EAAE,EAAE,MAAM,CAAC;CACd;AAED;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B;IAC9B,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IACpD,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,2BAA2B,CAAC;IACnC,OAAO,EAAE,6BAA6B,CAAC;IACvC,kEAAkE;IAClE,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAAC;CACxC;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC;;;OAGG;IACH,yBAAyB,CAAC,EAAE,kBAAkB,CAAC;CAClD"}
@@ -2,8 +2,7 @@ import { type IObjectPermissionsObject } from "@gooddata/sdk-backend-spi";
2
2
  import { type IGranularAccessGrantee } from "@gooddata/sdk-model";
3
3
  import { type GoodDataSdkError } from "@gooddata/sdk-ui";
4
4
  import { type GeneralAccessValue, type IUiGranteeAsyncOptions } from "@gooddata/sdk-ui-kit";
5
- import { type IRuleEdit } from "./objectShareController.helpers.js";
6
- import type { IObjectShareControllerState, IObjectShareGrantee, ISelfIdentity, ObjectSharePermissionLevel } from "./objectShareController.types.js";
5
+ import type { IObjectShareControllerState, IObjectShareDraft, IObjectShareGrantee, IRuleEdit, ISelfIdentity, ObjectSharePermissionLevel } from "./objectShareController.types.js";
7
6
  import type { IObjectAccessSummary } from "./types.js";
8
7
  /**
9
8
  * The owned access list for {@link useObjectShareController}.
@@ -104,6 +103,18 @@ export interface IAccessList {
104
103
  settleRuleEdit: () => void;
105
104
  /** Revert the rule edit after a failed write: the superseded committed edit, or the fetch. */
106
105
  failRuleEdit: () => void;
106
+ /** The overlay as a draft. Only meaningful in draft mode. */
107
+ draft: IObjectShareDraft;
108
+ }
109
+ /**
110
+ * Draft-mode inputs. See {@link IUseObjectShareOptions} for what each one means.
111
+ *
112
+ * @internal
113
+ */
114
+ export interface IAccessListDraftOptions {
115
+ draft?: boolean;
116
+ initialDraft?: IObjectShareDraft;
117
+ initialDraftGeneralAccess?: GeneralAccessValue;
107
118
  }
108
119
  /**
109
120
  * Owns the backend access list for ONE dialog session: the hook is mounted while
@@ -122,5 +133,5 @@ export interface IAccessList {
122
133
  *
123
134
  * @internal
124
135
  */
125
- export declare function useAccessList(target: IObjectPermissionsObject | undefined): IAccessList;
136
+ export declare function useAccessList(target: IObjectPermissionsObject | undefined, draftOptions?: IAccessListDraftOptions): IAccessList;
126
137
  //# sourceMappingURL=useAccessList.d.ts.map