@instructure/platform-block-content-editor 2.1.0 → 3.1.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.
Files changed (69) hide show
  1. package/dist/components/blocks/Quote/Quote.d.ts +1 -1
  2. package/dist/components/blocks/Quote/Quote.d.ts.map +1 -1
  3. package/dist/components/blocks/Quote/createQuoteBlock.d.ts +4 -1
  4. package/dist/components/blocks/Quote/createQuoteBlock.d.ts.map +1 -1
  5. package/dist/components/blocks/Quote/getQuoteViewProps.d.ts +16 -2
  6. package/dist/components/blocks/Quote/getQuoteViewProps.d.ts.map +1 -1
  7. package/dist/components/blocks/Quote/quotePropsSchema.d.ts +25 -5
  8. package/dist/components/blocks/Quote/quotePropsSchema.d.ts.map +1 -1
  9. package/dist/components/blocks/TwoColumn/createTwoColumnBlock.d.ts.map +1 -1
  10. package/dist/components/blocks/TwoColumn/twoColumnStyles.d.ts.map +1 -1
  11. package/dist/components/blocks/brandTheming.d.ts +11 -0
  12. package/dist/components/blocks/brandTheming.d.ts.map +1 -1
  13. package/dist/components/blocks/commonSchemas.d.ts +2 -2
  14. package/dist/components/blocks/commonSchemas.d.ts.map +1 -1
  15. package/dist/components/blocks/commonViewProps.d.ts +7 -1
  16. package/dist/components/blocks/commonViewProps.d.ts.map +1 -1
  17. package/dist/editor/ai/BlockAIMenu.d.ts +25 -1
  18. package/dist/editor/ai/BlockAIMenu.d.ts.map +1 -1
  19. package/dist/editor/ai/BlockAIMenuContent.d.ts +5 -1
  20. package/dist/editor/ai/BlockAIMenuContent.d.ts.map +1 -1
  21. package/dist/editor/ai/PanelAIMenu.d.ts +30 -0
  22. package/dist/editor/ai/PanelAIMenu.d.ts.map +1 -0
  23. package/dist/editor/ai/PreviewBlockModal.d.ts.map +1 -1
  24. package/dist/editor/ai/aiMenuStyles.d.ts +39 -2
  25. package/dist/editor/ai/aiMenuStyles.d.ts.map +1 -1
  26. package/dist/editor/ai/aiTranslations.d.ts +6 -2
  27. package/dist/editor/ai/aiTranslations.d.ts.map +1 -1
  28. package/dist/editor/ai/constants.d.ts +17 -0
  29. package/dist/editor/ai/constants.d.ts.map +1 -1
  30. package/dist/editor/ai/isBlockEmpty.d.ts +10 -0
  31. package/dist/editor/ai/isBlockEmpty.d.ts.map +1 -0
  32. package/dist/editor/ai/isBlockEmpty.test.d.ts +2 -0
  33. package/dist/editor/ai/isBlockEmpty.test.d.ts.map +1 -0
  34. package/dist/editor/ai/isItemEmpty.d.ts +18 -0
  35. package/dist/editor/ai/isItemEmpty.d.ts.map +1 -0
  36. package/dist/editor/ai/isItemEmpty.test.d.ts +2 -0
  37. package/dist/editor/ai/isItemEmpty.test.d.ts.map +1 -0
  38. package/dist/editor/ai/useBlockAIPopover.d.ts +7 -1
  39. package/dist/editor/ai/useBlockAIPopover.d.ts.map +1 -1
  40. package/dist/editor/canvas/GridItemChild.d.ts +2 -2
  41. package/dist/editor/canvas/GridItemChild.d.ts.map +1 -1
  42. package/dist/editor/canvas/canvasTranslations.d.ts +1 -5
  43. package/dist/editor/canvas/canvasTranslations.d.ts.map +1 -1
  44. package/dist/editor/sidebar/form/ComponentEditorForm.d.ts.map +1 -1
  45. package/dist/editor/sidebar/panel/DesignerSideBar.d.ts.map +1 -1
  46. package/dist/editor/sidebar/panel/ToolContentContainer.d.ts +5 -3
  47. package/dist/editor/sidebar/panel/ToolContentContainer.d.ts.map +1 -1
  48. package/dist/editor/sidebar/panel/ToolHeader.d.ts +2 -1
  49. package/dist/editor/sidebar/panel/ToolHeader.d.ts.map +1 -1
  50. package/dist/editor/sidebar/panel/ToolHeaderActionsContext.d.ts +6 -0
  51. package/dist/editor/sidebar/panel/ToolHeaderActionsContext.d.ts.map +1 -1
  52. package/dist/editor/sidebar/tray/blockDefinitions.d.ts.map +1 -1
  53. package/dist/editor/sidebar/useDesignerSelectionFocus.d.ts.map +1 -1
  54. package/dist/index.js +6710 -6319
  55. package/dist/registry/blockCatalogue.d.ts +73 -65
  56. package/dist/registry/blockCatalogue.d.ts.map +1 -1
  57. package/dist/registry/blockRegistry.d.ts +11 -7
  58. package/dist/registry/blockRegistry.d.ts.map +1 -1
  59. package/dist/registry/defineBlock.d.ts +1 -1
  60. package/dist/registry/defineBlock.d.ts.map +1 -1
  61. package/dist/registry/index.d.ts +2 -2
  62. package/dist/registry/index.d.ts.map +1 -1
  63. package/dist/schema/schemaRegistry.d.ts +4 -1
  64. package/dist/schema/schemaRegistry.d.ts.map +1 -1
  65. package/dist/utils/colorVariants/index.d.ts +1 -1
  66. package/dist/utils/colorVariants/index.d.ts.map +1 -1
  67. package/dist/viewer/Viewer.d.ts.map +1 -1
  68. package/locales/en.json +4 -4
  69. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
1
  import { QuoteProps } from './quotePropsSchema';
2
2
  /** Presentational blockquote with optional attribution; placeholder in empty designer mode. */
3
- export declare function Quote({ content, author, decorationStyle, cornerStyle, }: QuoteProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function Quote({ content, author, decorationStyle, cornerStyle, colorTheme, align, quoteSize, }: QuoteProps): import("react/jsx-runtime").JSX.Element;
4
4
  //# sourceMappingURL=Quote.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Quote.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/Quote/Quote.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,+FAA+F;AAC/F,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,MAAM,EACN,eAAwC,EACxC,WAAuB,GACxB,EAAE,UAAU,2CAsCZ"}
1
+ {"version":3,"file":"Quote.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/Quote/Quote.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAsC,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAcxF,+FAA+F;AAC/F,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,MAAM,EACN,eAAwB,EACxB,WAAuB,EACvB,UAAoB,EACpB,KAAc,EACd,SAA8B,GAC/B,EAAE,UAAU,2CA0DZ"}
@@ -5,8 +5,11 @@
5
5
  */
6
6
  export declare const createQuoteBlock: (options: import('../../..').BlockFactoryOptions<import('./quoteTranslations').QuoteTranslations>) => import('../../..').BlockRegistryEntry<{
7
7
  content: string;
8
+ colorTheme?: "light" | "dark" | "neutral" | undefined;
8
9
  cornerStyle?: "rounded" | "square" | undefined;
10
+ align?: "left" | "center" | "right" | undefined;
9
11
  author?: string | undefined;
10
- decorationStyle?: "none" | "background-secondary" | "background-grey" | "border-primary" | undefined;
12
+ quoteSize?: number | undefined;
13
+ decorationStyle?: "fill" | "none" | "sidebar" | undefined;
11
14
  }>;
12
15
  //# sourceMappingURL=createQuoteBlock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createQuoteBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/Quote/createQuoteBlock.ts"],"names":[],"mappings":"AAuBA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;EAM3B,CAAA"}
1
+ {"version":3,"file":"createQuoteBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/Quote/createQuoteBlock.ts"],"names":[],"mappings":"AAuBA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;EAM3B,CAAA"}
@@ -1,5 +1,19 @@
1
1
  import { BlockRenderProps } from '../brandTheming';
2
- import { CornerStyle } from '../commonSchemas';
2
+ import { Align, ColorTheme, CornerStyle } from '../commonSchemas';
3
3
  import { QuoteDecorationStyle } from './quotePropsSchema';
4
- export declare function getQuoteViewProps(decorationStyle: QuoteDecorationStyle, cornerStyle: CornerStyle, brandColor?: string): BlockRenderProps;
4
+ export declare function getQuoteViewProps(decorationStyle: QuoteDecorationStyle, cornerStyle: CornerStyle, colorTheme?: ColorTheme, brandColor?: string): BlockRenderProps;
5
+ export interface QuoteAlignmentProps {
6
+ quote: 'start' | 'center' | 'end';
7
+ author: 'center' | 'end';
8
+ }
9
+ /**
10
+ * The author trails the quote at the end of the line for both 'left' and 'right' —
11
+ * opposite the text when left-aligned, beside it when right-aligned — and only
12
+ * centers when the quote itself centers.
13
+ *
14
+ * 'sidebar' ignores `align` and pins left: its accent bar reads as the start of the
15
+ * line, and the host hides the Alignment control for it, so a value persisted under
16
+ * another style must not keep applying.
17
+ */
18
+ export declare function getQuoteAlignment(decorationStyle?: QuoteDecorationStyle, align?: Align): QuoteAlignmentProps;
5
19
  //# sourceMappingURL=getQuoteViewProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getQuoteViewProps.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/Quote/getQuoteViewProps.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,KAAK,gBAAgB,EAMtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAW9D,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,oBAAoB,EACrC,WAAW,EAAE,WAAW,EACxB,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CAwBlB"}
1
+ {"version":3,"file":"getQuoteViewProps.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/Quote/getQuoteViewProps.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,KAAK,gBAAgB,EAKtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAkC9D,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,oBAAoB,EACrC,WAAW,EAAE,WAAW,EACxB,UAAU,GAAE,UAAoB,EAChC,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CAiClB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACjC,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAA;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,eAAe,GAAE,oBAA6B,EAC9C,KAAK,GAAE,KAAc,GACpB,mBAAmB,CAMrB"}
@@ -1,28 +1,48 @@
1
1
  import { z } from 'zod';
2
- export declare const QuoteDecorationStyleSchema: z.ZodEnum<["none", "background-secondary", "background-grey", "border-primary"]>;
2
+ export declare const QuoteDecorationStyleSchema: z.ZodEnum<["none", "fill", "sidebar"]>;
3
+ export declare const QUOTE_SIZE_MIN = 16;
4
+ export declare const QUOTE_SIZE_MAX = 32;
5
+ export declare const QUOTE_SIZE_STEP = 2;
6
+ /** InstUI's `fontSizeXLarge` (1.75rem), the size the quote rendered at before
7
+ * `quoteSize` existed — so the default leaves existing quotes unchanged. */
8
+ export declare const QUOTE_SIZE_DEFAULT = 28;
9
+ /** `.parse()` is not on the render path, so the schema's min/max never run. */
10
+ export declare function clampQuoteSize(size: number): number;
3
11
  export declare const QuotePropsSchema: z.ZodObject<{
4
12
  content: z.ZodString;
5
13
  author: z.ZodOptional<z.ZodString>;
6
- decorationStyle: z.ZodOptional<z.ZodDefault<z.ZodEnum<["none", "background-secondary", "background-grey", "border-primary"]>>>;
14
+ quoteSize: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
15
+ decorationStyle: z.ZodOptional<z.ZodDefault<z.ZodEnum<["none", "fill", "sidebar"]>>>;
16
+ colorTheme: z.ZodOptional<z.ZodDefault<z.ZodEnum<["light", "dark", "neutral"]>>>;
17
+ align: z.ZodOptional<z.ZodDefault<z.ZodEnum<["left", "center", "right"]>>>;
7
18
  cornerStyle: z.ZodOptional<z.ZodDefault<z.ZodEnum<["rounded", "square"]>>>;
8
19
  }, "strip", z.ZodTypeAny, {
9
20
  content: string;
21
+ colorTheme?: "light" | "dark" | "neutral" | undefined;
10
22
  cornerStyle?: "rounded" | "square" | undefined;
23
+ align?: "left" | "center" | "right" | undefined;
11
24
  author?: string | undefined;
12
- decorationStyle?: "none" | "background-secondary" | "background-grey" | "border-primary" | undefined;
25
+ quoteSize?: number | undefined;
26
+ decorationStyle?: "fill" | "none" | "sidebar" | undefined;
13
27
  }, {
14
28
  content: string;
29
+ colorTheme?: "light" | "dark" | "neutral" | undefined;
15
30
  cornerStyle?: "rounded" | "square" | undefined;
31
+ align?: "left" | "center" | "right" | undefined;
16
32
  author?: string | undefined;
17
- decorationStyle?: "none" | "background-secondary" | "background-grey" | "border-primary" | undefined;
33
+ quoteSize?: number | undefined;
34
+ decorationStyle?: "fill" | "none" | "sidebar" | undefined;
18
35
  }>;
19
36
  export type QuoteProps = z.infer<typeof QuotePropsSchema>;
20
37
  export type QuoteDecorationStyle = z.infer<typeof QuoteDecorationStyleSchema>;
21
38
  export declare const QuoteDefaultProps: QuoteProps;
22
39
  export declare const RegisteredQuotePropsSchema: import('../../..').RegisteredComponentSchema<{
23
40
  content: string;
41
+ colorTheme?: "light" | "dark" | "neutral" | undefined;
24
42
  cornerStyle?: "rounded" | "square" | undefined;
43
+ align?: "left" | "center" | "right" | undefined;
25
44
  author?: string | undefined;
26
- decorationStyle?: "none" | "background-secondary" | "background-grey" | "border-primary" | undefined;
45
+ quoteSize?: number | undefined;
46
+ decorationStyle?: "fill" | "none" | "sidebar" | undefined;
27
47
  }>;
28
48
  //# sourceMappingURL=quotePropsSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"quotePropsSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/Quote/quotePropsSchema.ts"],"names":[],"mappings":"AAmBA,OAAO,+BAA+B,CAAA;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,0BAA0B,kFAKrC,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAqB3B,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E,eAAO,MAAM,iBAAiB,EAAE,UAI/B,CAAA;AAED,eAAO,MAAM,0BAA0B;;;;;EAAqD,CAAA"}
1
+ {"version":3,"file":"quotePropsSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/Quote/quotePropsSchema.ts"],"names":[],"mappings":"AAmBA,OAAO,+BAA+B,CAAA;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,0BAA0B,wCAAsC,CAAA;AAE7E,eAAO,MAAM,cAAc,KAAK,CAAA;AAChC,eAAO,MAAM,cAAc,KAAK,CAAA;AAChC,eAAO,MAAM,eAAe,IAAI,CAAA;AAChC;4EAC4E;AAC5E,eAAO,MAAM,kBAAkB,KAAK,CAAA;AAEpC,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKnD;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;EAwD3B,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E,eAAO,MAAM,iBAAiB,EAAE,UAO/B,CAAA;AAED,eAAO,MAAM,0BAA0B;;;;;;;;EAAqD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"createTwoColumnBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/TwoColumn/createTwoColumnBlock.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;EAO/B,CAAA"}
1
+ {"version":3,"file":"createTwoColumnBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/TwoColumn/createTwoColumnBlock.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;EAM/B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"twoColumnStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/TwoColumn/twoColumnStyles.tsx"],"names":[],"mappings":"AAiCA,eAAO,MAAM,gBAAgB;IAC3B;;;;OAIG;;;;CAIK,CAAA;AAqDV,+EAA+E;AAC/E,wBAAgB,eAAe,4CAE9B"}
1
+ {"version":3,"file":"twoColumnStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/TwoColumn/twoColumnStyles.tsx"],"names":[],"mappings":"AAkCA,eAAO,MAAM,gBAAgB;IAC3B;;;;OAIG;;;;CAIK,CAAA;AAkEV,+EAA+E;AAC/E,wBAAgB,eAAe,4CAE9B"}
@@ -81,6 +81,17 @@ export declare function brandFillStyling(brand: BrandVariant): Styling;
81
81
  * caller supplies the `borderWidth` (a full outline vs. a single-side accent).
82
82
  */
83
83
  export declare function brandBorderStyling(brand: BrandVariant, borderWidth: NonNullable<ViewProps['borderWidth']>): Styling;
84
+ /**
85
+ * Text-only treatment: recolor the text over a surface that stays transparent.
86
+ * For styles with no fill or border, where a color choice can only reach the text.
87
+ */
88
+ export declare function textStyling(color: string): Styling;
89
+ /**
90
+ * Accent treatment: one color drives both the border and the text, so an accent
91
+ * bar and the words beside it read as a pair. Unlike [[brandBorderStyling]], the
92
+ * text is recolored to match rather than left at its default.
93
+ */
94
+ export declare function accentStyling(color: string, borderWidth: NonNullable<ViewProps['borderWidth']>): Styling;
84
95
  /** Assemble the final render props from a resolved styling and layout. */
85
96
  export declare function toRenderProps(styling: Styling, layout: Layout): BlockRenderProps;
86
97
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"brandTheming.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/brandTheming.ts"],"names":[],"mappings":"AAkBA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AAM;IACrB,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAA;IACpD,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC9B;AAED,qFAAqF;AACrF,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/D,0DAA0D;AAC1D,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,IAAI,EAAE,SAAS,GACd,YAAY,GAAG,SAAS,CAW1B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAW7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,GACjD,OAAO,CAKT;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAUlD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,GACjD,OAAO,CAWT;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAWhF"}
@@ -2,11 +2,11 @@ import { z } from 'zod';
2
2
  /** Corner rounding for a block's container. Used by every block. */
3
3
  export declare const CornerStyleSchema: z.ZodEnum<["rounded", "square"]>;
4
4
  export type CornerStyle = z.infer<typeof CornerStyleSchema>;
5
- /** Horizontal alignment for the media blocks (Image, Video). */
5
+ /** Horizontal alignment. Used by Image, Video and Quote. */
6
6
  export declare const AlignSchema: z.ZodEnum<["left", "center", "right"]>;
7
7
  export type Align = z.infer<typeof AlignSchema>;
8
8
  /**
9
- * Emphasis a block's surface is decorated with. Used by Text and Accordion.
9
+ * Emphasis a block's surface is decorated with. Used by Text, Accordion and Quote.
10
10
  * `neutral` is deliberately never branded — see the block mappers.
11
11
  */
12
12
  export declare const ColorThemeSchema: z.ZodEnum<["light", "dark", "neutral"]>;
@@ -1 +1 @@
1
- {"version":3,"file":"commonSchemas.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/commonSchemas.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,kCAAgC,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,gEAAgE;AAChE,eAAO,MAAM,WAAW,wCAAsC,CAAA;AAC9D,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAE/C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,yCAAuC,CAAA;AACpE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,yFAAyF;AACzF,eAAO,MAAM,kBAAkB,+BAA6B,CAAA;AAC5D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,sCAAoC,CAAA;AAClE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gGAC4D,CAAA"}
1
+ {"version":3,"file":"commonSchemas.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/commonSchemas.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,kCAAgC,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,4DAA4D;AAC5D,eAAO,MAAM,WAAW,wCAAsC,CAAA;AAC9D,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAE/C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,yCAAuC,CAAA;AACpE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,yFAAyF;AACzF,eAAO,MAAM,kBAAkB,+BAA6B,CAAA;AAC5D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,sCAAoC,CAAA;AAClE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gGAC4D,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { View } from '@instructure/ui-view';
2
2
  import { ComponentProps } from 'react';
3
- import { Styling } from './brandTheming';
3
+ import { Decoration, Styling } from './brandTheming';
4
4
  import { Align, ColorTheme, HeaderStyle } from './commonSchemas';
5
5
  type ViewProps = ComponentProps<typeof View>;
6
6
  /** Horizontal alignment as a `View` `textAlign` token. */
@@ -27,6 +27,12 @@ export declare function getHeaderStyleStyling(headerStyle: HeaderStyle, brandCol
27
27
  * `fill` and Banner's `solid` are the same treatment.
28
28
  */
29
29
  export type SurfaceStyle = 'none' | 'outline' | 'fill';
30
+ /**
31
+ * The undecorated surface: no fill, no border, text left to the theme. Exported for
32
+ * blocks that resolve their own text color and need only the bare surface under it
33
+ * (Quote's `none`).
34
+ */
35
+ export declare const SURFACE_NONE_DECORATION: Decoration;
30
36
  /**
31
37
  * Styling for a surface/color pair, where the surface treatment is an option of its own
32
38
  * rather than implied by the color (as `getHeaderStyleStyling` has it). A brand color
@@ -1 +1 @@
1
- {"version":3,"file":"commonViewProps.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/commonViewProps.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAML,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAErE,KAAK,SAAS,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,CAAA;AAE5C,0DAA0D;AAC1D,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAIzE,CAAA;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAA;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAA;CACrD;AAwBD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAK5F;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAA;AAyDtD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,UAAU,EACjB,UAAU,CAAC,EAAE,MAAM,G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,MAAM,uBAAuB,EAAE,UAIrC,CAAA;AAmDD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,UAAU,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAYT;AAmBD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,GAClB,eAAe,CAiBjB"}
@@ -12,6 +12,30 @@ export interface BlockAIMenuProps {
12
12
  componentRegistry: BlockRegistry;
13
13
  /** Fires when the menu popover OR the preview modal is open, so the canvas can hold selection. */
14
14
  onActiveChange?: (active: boolean) => void;
15
+ /**
16
+ * Names the sub-block this menu was opened on (e.g. `Accordion 1`) when it is mounted on a
17
+ * sub-block panel. Scopes the instruction sent to the AI; the request still carries the whole
18
+ * block, and the reply is still applied whole, exactly as it is from the block's own menu.
19
+ */
20
+ instructionScope?: string;
21
+ /**
22
+ * Overrides which view the menu opens on. Supply this when the menu targets something
23
+ * `isBlockEmpty` cannot judge — a sub-block, whose content is one entry of an array field
24
+ * rather than the block's own props. Defaults to the block's own emptiness.
25
+ */
26
+ isEmpty?: boolean;
27
+ /**
28
+ * Human name for what the menu acts on, used in the trigger's accessible label — the block's
29
+ * host-translated label ("Banner"), or a sub-block's heading ("Accordion 1"). Defaults to the
30
+ * wire name, which is what the canvas item toolbar has always announced.
31
+ */
32
+ targetLabel?: string;
33
+ /**
34
+ * Surface the trigger sits on. `dark` (the default) is the canvas item toolbar's bar; `light`
35
+ * is the sidebar panel header, which has no chrome of its own and so carries the open state
36
+ * as a tinted outline around the icon.
37
+ */
38
+ triggerSurface?: 'dark' | 'light';
15
39
  }
16
- export declare const BlockAIMenu: ({ componentType, componentData, componentId, isOpen, onOpen, onApply, onClose, componentRegistry, onActiveChange, }: BlockAIMenuProps) => import("react/jsx-runtime").JSX.Element | null;
40
+ export declare const BlockAIMenu: ({ componentType, componentData, componentId, isOpen, onOpen, onApply, onClose, componentRegistry, onActiveChange, instructionScope, isEmpty, targetLabel, triggerSurface, }: BlockAIMenuProps) => import("react/jsx-runtime").JSX.Element | null;
17
41
  //# sourceMappingURL=BlockAIMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockAIMenu.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/BlockAIMenu.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,aAAa,EAA4B,MAAM,gBAAgB,CAAA;AAQ7E,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACpD,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,iGAAiG;IACjG,iBAAiB,EAAE,aAAa,CAAA;IAChC,kGAAkG;IAClG,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;CAC3C;AAED,eAAO,MAAM,WAAW,GAAI,qHAUzB,gBAAgB,mDAkIlB,CAAA"}
1
+ {"version":3,"file":"BlockAIMenu.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/BlockAIMenu.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,aAAa,EAA4B,MAAM,gBAAgB,CAAA;AAS7E,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACpD,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,iGAAiG;IACjG,iBAAiB,EAAE,aAAa,CAAA;IAChC,kGAAkG;IAClG,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IAC1C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAClC;AAED,eAAO,MAAM,WAAW,GAAI,6KAczB,gBAAgB,mDAoLlB,CAAA"}
@@ -4,6 +4,10 @@ export interface BlockAIMenuContentProps {
4
4
  onSetView: (view: MenuView) => void;
5
5
  onQuickAction: (instruction: string) => void;
6
6
  activeInstruction?: string | null;
7
+ /** False for an untouched block, which shows only the generate prompt and no root menu. */
8
+ hasContent: boolean;
9
+ /** Dismisses the menu from the prompt header, standing in for Back when there is no root. */
10
+ onClose: () => void;
7
11
  prompt: string;
8
12
  onPromptChange: (value: string) => void;
9
13
  isThinking: boolean;
@@ -13,5 +17,5 @@ export interface BlockAIMenuContentProps {
13
17
  onSend: () => void;
14
18
  onStop: () => void;
15
19
  }
16
- export declare const BlockAIMenuContent: ({ view, onSetView, onQuickAction, activeInstruction, prompt, onPromptChange, isThinking, error, previewFirst, onPreviewFirstChange, onSend, onStop, }: BlockAIMenuContentProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const BlockAIMenuContent: ({ view, onSetView, onQuickAction, activeInstruction, hasContent, onClose, prompt, onPromptChange, isThinking, error, previewFirst, onPreviewFirstChange, onSend, onStop, }: BlockAIMenuContentProps) => import("react/jsx-runtime").JSX.Element;
17
21
  //# sourceMappingURL=BlockAIMenuContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockAIMenuContent.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/BlockAIMenuContent.tsx"],"names":[],"mappings":"AAsCA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,eAAe,GAAG,sBAAsB,CAAA;AAkDnG,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,QAAQ,CAAA;IACd,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;IACnC,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEjC,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,oBAAoB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED,eAAO,MAAM,kBAAkB,GAAI,uJAahC,uBAAuB,4CAyLzB,CAAA"}
1
+ {"version":3,"file":"BlockAIMenuContent.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/BlockAIMenuContent.tsx"],"names":[],"mappings":"AA4CA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,eAAe,GAAG,sBAAsB,CAAA;AA4DnG,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,QAAQ,CAAA;IACd,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;IACnC,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,2FAA2F;IAC3F,UAAU,EAAE,OAAO,CAAA;IACnB,6FAA6F;IAC7F,OAAO,EAAE,MAAM,IAAI,CAAA;IAEnB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,oBAAoB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED,eAAO,MAAM,kBAAkB,GAAI,4KAehC,uBAAuB,4CAwOzB,CAAA"}
@@ -0,0 +1,30 @@
1
+ import { BlockRegistry } from '../../registry';
2
+ import { FormFieldMetadata } from '../../schema';
3
+ /** Identifies the one sub-block a panel is scoped to, when the panel is not the block's own. */
4
+ export interface PanelAIMenuScope {
5
+ /** Shown to the author and sent to the AI as the target's name, e.g. `Accordion 1`. */
6
+ label: string;
7
+ /** The object-array field holding the sub-blocks, e.g. `items`. */
8
+ fieldName: string;
9
+ index: number;
10
+ /** Property metadata for one entry of that field, used to judge whether it is untouched. */
11
+ itemProperties: Record<string, FormFieldMetadata>;
12
+ }
13
+ export interface PanelAIMenuProps {
14
+ componentType: string;
15
+ componentId?: string;
16
+ componentRegistry: BlockRegistry;
17
+ /** Reads the block's current form values. Must be stable across renders. */
18
+ getCurrentProps: () => Record<string, unknown>;
19
+ /** Applies the AI's props to the form and commits them. Must be stable across renders. */
20
+ onApply: (newProps: Record<string, unknown>) => void;
21
+ /**
22
+ * The block's host-translated label, announced when the panel is the block's own. A sub-block
23
+ * panel announces its own heading instead, from `scope.label`.
24
+ */
25
+ blockLabel?: string;
26
+ /** Set when the panel is a sub-block's; omit for the block's own panel. */
27
+ scope?: PanelAIMenuScope;
28
+ }
29
+ export declare function PanelAIMenu({ componentType, componentId, componentRegistry, getCurrentProps, onApply, blockLabel, scope, }: PanelAIMenuProps): import("react/jsx-runtime").JSX.Element | null;
30
+ //# sourceMappingURL=PanelAIMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelAIMenu.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/PanelAIMenu.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAIrD,gGAAgG;AAChG,MAAM,WAAW,gBAAgB;IAC/B,uFAAuF;IACvF,KAAK,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,4FAA4F;IAC5F,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;CAClD;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,EAAE,aAAa,CAAA;IAChC,4EAA4E;IAC5E,eAAe,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9C,0FAA0F;IAC1F,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACpD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,gBAAgB,CAAA;CACzB;AAED,wBAAgB,WAAW,CAAC,EAC1B,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,OAAO,EACP,UAAU,EACV,KAAK,GACN,EAAE,gBAAgB,kDAgDlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PreviewBlockModal.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/PreviewBlockModal.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAS9F,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,YAAY,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,sEAAsE;IACtE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,EAAE,UAAU,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE,YAAY,CAAA;IACzB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,kFAAkF;IAClF,iBAAiB,EAAE,aAAa,CAAA;IAChC,mCAAmC;IACnC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;CACrD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAAI,qKAa/B,sBAAsB,4CA4KxB,CAAA"}
1
+ {"version":3,"file":"PreviewBlockModal.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/PreviewBlockModal.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAS9F,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,YAAY,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,sEAAsE;IACtE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,EAAE,UAAU,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE,YAAY,CAAA;IACzB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,kFAAkF;IAClF,iBAAiB,EAAE,aAAa,CAAA;IAChC,mCAAmC;IACnC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;CACrD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAAI,qKAa/B,sBAAsB,4CAgLxB,CAAA"}
@@ -3,9 +3,22 @@
3
3
  * (hover/focus/disabled) and the free-text prompt row. None of it is expressible in InstUI
4
4
  * props — it needs `:hover`/`:focus-visible`/`:disabled` states and a borderless input — so it
5
5
  * is injected once as a global stylesheet keyed by stable class names, the same way the canvas
6
- * and preview chrome are. The source's `theme.gradients.igniteAI` branding is neutralized to
7
- * plain InstUI surface tokens; the AI accent lives in the colored AI icon on the trigger.
6
+ * and preview chrome are. The card and rows use plain InstUI surface tokens; the AI accent is the
7
+ * colored AI icon on the trigger plus the gradient clipped to the prompt-header title below.
8
8
  */
9
+ /**
10
+ * Card and send-button radius: 12px, matching canvas-horizon's `radiusSmallMedium`. A literal,
11
+ * not a `borders.*` token, because the two hosts' scales collide on names — `radiusLarge` is 8px
12
+ * on InstUI's canvas theme and 32px on horizon's — and canvas has no 12px step at all, so no
13
+ * token name means 12px in both.
14
+ */
15
+ export declare const AI_MENU_RADIUS = "0.75rem";
16
+ /**
17
+ * The menu trigger's open-state radius: 8px, for the same reason as {@link AI_MENU_RADIUS} — a
18
+ * literal, because `borders.radiusLarge` is 8px on InstUI's canvas theme but 32px on horizon's,
19
+ * which would round the trigger into a pill on one host and a square on the other.
20
+ */
21
+ export declare const AI_TRIGGER_RADIUS = "0.5rem";
9
22
  export declare const AI_CLASS: {
10
23
  readonly root: "bce-ai-menu-root";
11
24
  readonly card: "bce-ai-menu-card";
@@ -13,11 +26,35 @@ export declare const AI_CLASS: {
13
26
  readonly item: "bce-ai-menu-item";
14
27
  readonly itemLabel: "bce-ai-menu-item-label";
15
28
  readonly subHeader: "bce-ai-menu-subheader";
29
+ readonly gradientTitle: "bce-ai-menu-gradient-title";
30
+ readonly promptHeader: "bce-ai-menu-prompt-header";
31
+ readonly charCount: "bce-ai-menu-char-count";
16
32
  readonly input: "bce-ai-menu-input";
17
33
  readonly footer: "bce-ai-menu-footer";
18
34
  readonly thinkingBody: "bce-ai-menu-thinking";
19
35
  readonly thinkingStatus: "bce-ai-menu-thinking-status";
36
+ /** Wrapper around the menu trigger when it sits on a light surface (the sidebar panel header). */
37
+ readonly lightTrigger: "bce-ai-menu-light-trigger";
38
+ readonly lightTriggerOpen: "bce-ai-menu-light-trigger-open";
20
39
  };
21
40
  /** Mounts the AI menu chrome stylesheet once, under the menu popover. */
22
41
  export declare function AIMenuStyles(): import("react/jsx-runtime").JSX.Element;
42
+ /**
43
+ * The menu trigger on a light surface — the sidebar panel header. Closed, it is the bare
44
+ * gradient icon; open, that icon sits in a rounded square outlined in the same violet→sea
45
+ * gradient over a light tint of it. The icon itself is unchanged between the two states — the
46
+ * highlight is what moves.
47
+ *
48
+ * The canvas item toolbar's trigger needs none of this: it sits on a dark bar that already
49
+ * reads as a container, so it swaps a monochrome icon for a colored one instead.
50
+ *
51
+ * Separate from `AIMenuStyles` because that stylesheet mounts with the *open* popover's content,
52
+ * and this has to be present while the trigger is merely rendered. Kept out of `AIMenuStyles`
53
+ * rather than hoisting that component so a canvas full of blocks does not mount one copy of the
54
+ * whole menu stylesheet per block.
55
+ *
56
+ * `withBackground={false}` on the InstUI IconButton leaves the button transparent, so the
57
+ * selectors below only have to add paint, never undo any.
58
+ */
59
+ export declare function AITriggerStyles(): import("react/jsx-runtime").JSX.Element;
23
60
  //# sourceMappingURL=aiMenuStyles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aiMenuStyles.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/aiMenuStyles.tsx"],"names":[],"mappings":"AAoBA;;;;;;;GAOG;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;CAWX,CAAA;AAmBV,yEAAyE;AACzE,wBAAgB,YAAY,4CA+G3B"}
1
+ {"version":3,"file":"aiMenuStyles.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/aiMenuStyles.tsx"],"names":[],"mappings":"AAoBA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,cAAc,YAAY,CAAA;AAEvC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,WAAW,CAAA;AAEzC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;IAcnB,kGAAkG;;;CAG1F,CAAA;AAyBV,yEAAyE;AACzE,wBAAgB,YAAY,4CA8J3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,4CAgD9B"}
@@ -18,8 +18,10 @@ export interface DesignerAITranslations {
18
18
  aiActions: string;
19
19
  /** Back link from a submenu to the root menu. */
20
20
  backToMenu: string;
21
- /** Root action + prompt-view header: open a free-text regenerate prompt. */
22
- regenerateWithPrompt: string;
21
+ /** Root action + prompt-view header: open the free-text generate prompt. */
22
+ generateWithIdea: string;
23
+ /** Closes the menu from the prompt-view header, when there is no root menu to go back to. */
24
+ closeAiActions: string;
23
25
  /** Root action: open the tone submenu. */
24
26
  changeTone: string;
25
27
  /** Root action: open the length submenu. */
@@ -41,6 +43,8 @@ export interface DesignerAITranslations {
41
43
  readingAdvanced: string;
42
44
  /** Prompt input label/placeholder. */
43
45
  promptPlaceholder: string;
46
+ /** Live character count on the prompt. `%{count}` of `%{max}`. */
47
+ promptCharacterCount: string;
44
48
  /** Toggle: show the before/after preview before applying. */
45
49
  previewFirst: string;
46
50
  /** Send the prompt. */
@@ -1 +1 @@
1
- {"version":3,"file":"aiTranslations.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/aiTranslations.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,sBAAsB;IACrC,iGAAiG;IACjG,WAAW,EAAE,MAAM,CAAA;IACnB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,oBAAoB,EAAE,MAAM,CAAA;IAC5B,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,mDAAmD;IACnD,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;IACzB,kCAAkC;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,eAAe,EAAE,MAAM,CAAA;IACvB,sCAAsC;IACtC,iBAAiB,EAAE,MAAM,CAAA;IACzB,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAA;IACpB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,oFAAoF;IACpF,gBAAgB,EAAE,MAAM,CAAA;IACxB,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAA;IACpB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,kFAAkF;IAClF,qBAAqB,EAAE,MAAM,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,4DAA4D;IAC5D,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,EAAE,sBAuC/B,CAAA"}
1
+ {"version":3,"file":"aiTranslations.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/aiTranslations.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,sBAAsB;IACrC,iGAAiG;IACjG,WAAW,EAAE,MAAM,CAAA;IACnB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,CAAA;IACxB,6FAA6F;IAC7F,cAAc,EAAE,MAAM,CAAA;IACtB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,mDAAmD;IACnD,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;IACzB,kC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"before";
6
6
  };
7
7
  export type PreviewBlockView = (typeof PREVIEW_BLOCK_VIEWS)[keyof typeof PREVIEW_BLOCK_VIEWS];
8
+ /** Cap on the free-text generate prompt, matching the character counter shown beside it. */
9
+ export declare const PROMPT_MAX_LENGTH = 100;
10
+ /**
11
+ * Marks a portaled AI surface — the menu card and the before/after preview — so the designer's
12
+ * canvas↔panel selection coordination can tell "focus moved into one of our own overlays" from
13
+ * "focus left the editor entirely" and deselected the block.
14
+ *
15
+ * A DOM marker rather than a callback because a portal renders outside both the canvas and the
16
+ * tool panel, so neither side can reach it through the React tree; `useDesignerSelectionFocus`
17
+ * already reads the canvas's equivalent marker class the same way. Sniffed document-wide, so it
18
+ * only has to be present *somewhere* inside the overlay.
19
+ */
20
+ export declare const DESIGNER_OVERLAY_ATTR: {
21
+ readonly 'data-designer-overlay': "true";
22
+ };
23
+ /** Matches {@link DESIGNER_OVERLAY_ATTR}. */
24
+ export declare const DESIGNER_OVERLAY_SELECTOR = "[data-designer-overlay]";
8
25
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/constants.ts"],"names":[],"mappings":"AAkBA,iEAAiE;AACjE,eAAO,MAAM,mBAAmB;;;;CAItB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/constants.ts"],"names":[],"mappings":"AAkBA,iEAAiE;AACjE,eAAO,MAAM,mBAAmB;;;;CAItB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAA;AAE7F,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,MAAM,CAAA;AAEpC;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB;;CAA+C,CAAA;AAEjF,6CAA6C;AAC7C,eAAO,MAAM,yBAAyB,4BAA4B,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { BlockRegistry } from '../../registry';
2
+ /**
3
+ * True when a block still holds exactly what it was registered with. Drives which AI menu it
4
+ * gets: an untouched block opens on the generate prompt, having nothing yet to change the tone,
5
+ * length, or reading level of. Editing content or styling counts as touching it; moving does not.
6
+ *
7
+ * Internal by choice — it reads the registry, but no host has asked for it.
8
+ */
9
+ export declare function isBlockEmpty(registry: BlockRegistry, componentName: string, componentData: Record<string, unknown>): boolean;
10
+ //# sourceMappingURL=isBlockEmpty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isBlockEmpty.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/isBlockEmpty.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,gBAAgB,CAAA;AAoBtE;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,aAAa,EACvB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CA0BT"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isBlockEmpty.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isBlockEmpty.test.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/isBlockEmpty.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { FormFieldMetadata } from '../../schema';
2
+ /**
3
+ * True when a sub-block (one entry of an object-array field, e.g. an Accordion section or a
4
+ * flash card) still holds exactly what it was created with. The sub-block twin of
5
+ * `isBlockEmpty`, and it drives the same decision: an untouched sub-block opens the AI menu on
6
+ * the generate prompt, having nothing yet to change the tone, length, or reading level of.
7
+ *
8
+ * A block's registered defaults can already contain blank items — an Accordion ships with three —
9
+ * so this reads the field's `itemProperties`, not the block's `defaultProps`.
10
+ */
11
+ export declare function isItemEmpty(itemProperties: Record<string, FormFieldMetadata>, item: Record<string, unknown> | undefined): boolean;
12
+ /**
13
+ * True when a sub-block has at least one prose property. Gates whether its panel offers AI at
14
+ * all — the menu's four actions all rewrite text, so an item made only of enums and colors has
15
+ * nothing for them to do.
16
+ */
17
+ export declare function itemHasTextFields(itemProperties: Record<string, FormFieldMetadata>): boolean;
18
+ //# sourceMappingURL=isItemEmpty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isItemEmpty.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/isItemEmpty.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,iBAAiB,EAAiB,MAAM,cAAc,CAAA;AA6CpE;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EACjD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACxC,OAAO,CAKT;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,OAAO,CAE5F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isItemEmpty.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isItemEmpty.test.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/isItemEmpty.test.ts"],"names":[],"mappings":""}
@@ -2,6 +2,12 @@ interface UseBlockAIPopoverProps {
2
2
  componentType: string;
3
3
  componentData: Record<string, unknown>;
4
4
  componentId?: string;
5
+ /**
6
+ * Names the sub-block the menu was opened on (e.g. `Accordion 1`), when it was opened from a
7
+ * sub-block panel rather than the block itself. The request still carries the whole block —
8
+ * the agent needs the siblings for context — so this is what tells it which part to rewrite.
9
+ */
10
+ instructionScope?: string;
5
11
  onApply: (newProps: Record<string, unknown>) => void;
6
12
  onClose: () => void;
7
13
  }
@@ -11,7 +17,7 @@ interface UseBlockAIPopoverProps {
11
17
  * `useAIAction()` seam (the host closes over course/chat context) and preserves the abort signal
12
18
  * for `handleStop`. If no seam is provided it is inert.
13
19
  */
14
- export declare const useBlockAIPopover: ({ componentType, componentData, componentId, onApply, onClose, }: UseBlockAIPopoverProps) => {
20
+ export declare const useBlockAIPopover: ({ componentType, componentData, componentId, instructionScope, onApply, onClose, }: UseBlockAIPopoverProps) => {
15
21
  prompt: string;
16
22
  setPrompt: import('react').Dispatch<import('react').SetStateAction<string>>;
17
23
  isThinking: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useBlockAIPopover.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/useBlockAIPopover.ts"],"names":[],"mappings":"AAyBA,UAAU,sBAAsB;IAC9B,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACpD,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,kEAM/B,sBAAsB;;;;;;;;;+BAoDiB,MAAM;;uCAwBE,MAAM;;;CAgDvD,CAAA"}
1
+ {"version":3,"file":"useBlockAIPopover.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/useBlockAIPopover.ts"],"names":[],"mappings":"AAyBA,UAAU,sBAAsB;IAC9B,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACpD,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,oFAO/B,sBAAsB;;;;;;;;;+BA2DiB,MAAM;;uCAwBE,MAAM;;;CAgDvD,CAAA"}
@@ -25,8 +25,8 @@ export interface DesignerItemUIProps {
25
25
  onAIApply?: (newProps: Record<string, unknown>) => void;
26
26
  /** Composed by the host — passed to the AI menu to render the before/after preview + resolve. */
27
27
  componentRegistry?: BlockRegistry;
28
- /** Callback when delete is confirmed via the popover. */
29
- onDeleteConfirm?: () => void;
28
+ /** Callback when the delete action is clicked. */
29
+ onDeleteClick?: () => void;
30
30
  /** Ref and props for the drag handle (from `useSortable`). */
31
31
  dragHandleProps?: Record<string, unknown>;
32
32
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"GridItemChild.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/GridItemChild.tsx"],"names":[],"mappings":"AAmCA,OAAO,EAAc,KAAK,SAAS,EAAyB,MAAM,OAAO,CAAA;AAGzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAInE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,SAAS,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qFAAqF;IACrF,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,WAAW,EAAE,CAAC,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,IAAI,CAAA;IACzD,gBAAgB,EAAE,C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AE,OAAO,CAAA;IACzB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,WAAW,EAAE,CAAC,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,IAAI,CAAA;IACzD,gBAAgB,EAAE,CAAC,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,IAAI,CAAA;IAC9D,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,wDAAwD;IACxD,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACvD,iGAAiG;IACjG,iBAAiB,CAAC,EAAE,aAAa,CAAA;IACjC,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,8DAA8D;IAC9D,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC;;;OAGG;IACH,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAA;IACpC,mFAAmF;IACnF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,cAAc,gHA+I1B,CAAA;AAID,eAAe,cAAc,CAAA"}
@@ -42,12 +42,8 @@ export interface DesignerChromeTranslations {
42
42
  duplicate: string;
43
43
  /** Delete button screen-reader label. */
44
44
  deleteComponent: string;
45
- /** Delete button tooltip and confirm action. */
45
+ /** Delete button tooltip. */
46
46
  delete: string;
47
- /** Delete confirmation prompt. */
48
- deleteConfirmation: string;
49
- /** Cancel button in the delete confirmation. */
50
- cancel: string;
51
47
  /** Component overlay `aria-label` opening the settings for a block. */
52
48
  editComponent: string;
53
49
  /** `aria-label` for the group wrapping a block on the canvas. */
@@ -1 +1 @@
1
- {"version":3,"file":"canvasTranslations.d.ts","s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AAA;CACvB;AAED,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,EAAE,0BA2BnC,CAAA"}
1
+ {"version":3,"file":"canvasTranslations.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/canvasTranslations.ts"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,MAAM,WAAW,0BAA0B;IACzC,2FAA2F;IAC3F,IAAI,EAAE,MAAM,CAAA;IACZ,kFAAkF;IAClF,QAAQ,EAAE,MAAM,CAAA;IAChB,wEAAwE;IACxE,eAAe,EAAE,MAAM,CAAA;IACvB,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAA;IAClB,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAA;IAClB,sFAAsF;IACtF,oBAAoB,EAAE,MAAM,CAAA;IAC5B,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAA;IACrB,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,CAAA;IACxB,kEAAkE;IAClE,gBAAgB,EAAE,MAAM,CAAA;IACxB,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAA;IACrB,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,4CAA4C;IAC5C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,yCAAyC;IACzC,eAAe,EAAE,MAAM,CAAA;IACvB,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,uEAAuE;IACvE,aAAa,EAAE,MAAM,CAAA;IACrB,iEAAiE;IACjE,cAAc,EAAE,MAAM,CAAA;IACtB,gEAAgE;IAChE,eAAe,EAAE,MAAM,CAAA;IACvB,iEAAiE;IACjE,gBAAgB,EAAE,MAAM,CAAA;IACxB,qDAAqD;IACrD,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,EAAE,0BAyBnC,CAAA"}