@mathews_cometchat/bubble-builder 1.0.0-alpha22 → 1.0.0-alpha24

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.
@@ -7,3 +7,5 @@ export interface ComponentTemplate {
7
7
  }
8
8
  export declare const COMPONENT_TEMPLATES: ComponentTemplate[];
9
9
  export declare const COMPONENT_CATEGORIES: string[];
10
+ export declare const COMPONENT_TEMPLATE_NAMES: readonly ["Product Card", "Order Confirmation", "Announcement", "Quick Reply Buttons", "Order Tracking", "Event Card", "Feedback", "Data Table", "Carousel"];
11
+ export type ComponentTemplateName = typeof COMPONENT_TEMPLATE_NAMES[number];
package/dist/lib.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { BubbleMessage } from './types/schema';
1
+ import type { BubbleMessage, ElementType } from './types/schema';
2
+ import type { ComponentTemplateName } from './config/component-templates';
2
3
  import type { BubbleVariable, NotificationConfig, BuilderChannels } from './config/builder-config';
3
4
  import './index.css';
4
5
  export type { BubbleVariable } from './config/builder-config';
@@ -28,18 +29,24 @@ export interface BubbleBuilderOptions {
28
29
  channels?: BuilderChannels;
29
30
  /** Push notification preview config (app name, icon). Only used when channels is 'push' or 'both'. */
30
31
  notification?: NotificationConfig;
32
+ /** Element types to hide from the palette (e.g. ['codeBlock', 'table', 'markdown']) */
33
+ hiddenElements?: ElementType[];
34
+ /** Component template names to hide from the palette (e.g. ['Product Card', 'Data Table']) */
35
+ hiddenComponents?: ComponentTemplateName[];
31
36
  }
32
37
  export interface BubbleBuilderInstance {
33
38
  loadBubble: (bubble: BubbleMessage, name?: string) => void;
34
39
  getBubbleJSON: () => BubbleMessage;
35
- /** Update the available variables for {{placeholder}} insertion at any time */
36
40
  setVariables: (variables: BubbleVariable[]) => void;
37
- /** Switch which channels are available: 'inapp', 'push', or 'both' */
38
41
  setChannels: (channels: BuilderChannels) => void;
39
- /** Switch between 'bubble' (in-app) and 'notification' (push) canvas views */
40
42
  setCanvasView: (view: 'bubble' | 'notification') => void;
43
+ /** Hide specific element types from the palette. Pass element type names (e.g. 'codeBlock', 'table'). */
44
+ setHiddenElements: (types: ElementType[]) => void;
45
+ /** Hide specific component templates from the palette. Pass template names (e.g. 'Product Card'). */
46
+ setHiddenComponents: (names: ComponentTemplateName[]) => void;
41
47
  destroy: () => void;
42
48
  }
43
49
  export { builderConfig } from './config/builder-config';
44
50
  export declare function mountBubbleBuilder(container: HTMLElement, options: BubbleBuilderOptions): BubbleBuilderInstance;
45
- export type { BubbleMessage } from './types/schema';
51
+ export type { BubbleMessage, ElementType } from './types/schema';
52
+ export type { ComponentTemplateName } from './config/component-templates';
@@ -1,4 +1,5 @@
1
- import type { BubbleElement, BubbleSettings, BubbleMessage, Template } from '../types/schema';
1
+ import type { BubbleElement, BubbleSettings, BubbleMessage, Template, ElementType } from '../types/schema';
2
+ import type { ComponentTemplateName } from '../config/component-templates';
2
3
  import type { BubbleVariable } from '../config/builder-config';
3
4
  export interface BuilderState {
4
5
  templateId: string | null;
@@ -18,6 +19,10 @@ export interface BuilderState {
18
19
  selectedPaths: number[][];
19
20
  isDirty: boolean;
20
21
  useThemePlaceholders: boolean;
22
+ /** Element types hidden from the palette */
23
+ hiddenElements: Set<ElementType>;
24
+ /** Component template names hidden from the palette */
25
+ hiddenComponents: Set<ComponentTemplateName>;
21
26
  view: 'library' | 'editor';
22
27
  clipboard: BubbleElement | null;
23
28
  showTemplatePicker: boolean;
@@ -54,6 +59,8 @@ export interface BuilderState {
54
59
  setNotificationEnabled: (enabled: boolean) => void;
55
60
  setCanvasView: (view: 'bubble' | 'notification') => void;
56
61
  setChannels: (channels: 'inapp' | 'push' | 'both') => void;
62
+ setHiddenElements: (types: ElementType[]) => void;
63
+ setHiddenComponents: (names: ComponentTemplateName[]) => void;
57
64
  setUseThemePlaceholders: (use: boolean) => void;
58
65
  setVariables: (variables: BubbleVariable[]) => void;
59
66
  setTemplateName: (name: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathews_cometchat/bubble-builder",
3
- "version": "1.0.0-alpha22",
3
+ "version": "1.0.0-alpha24",
4
4
  "type": "module",
5
5
  "main": "dist/bubble-builder.umd.js",
6
6
  "module": "dist/bubble-builder.es.js",