@plasmicpkgs/plasmic-intercom 0.0.11 → 0.0.13

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.
@@ -1,4 +1,4 @@
1
- import { ComponentMeta } from "@plasmicapp/host";
1
+ import { CodeComponentMeta } from "@plasmicapp/host/registerComponent";
2
2
  import React from "react";
3
3
  export declare function ensure<T>(x: T | null | undefined): T;
4
4
  interface IntercomProviderProps {
@@ -10,6 +10,6 @@ interface IntercomProviderProps {
10
10
  initializeDelay?: number;
11
11
  className?: string;
12
12
  }
13
- export declare const IntercomProviderMeta: ComponentMeta<IntercomProviderProps>;
13
+ export declare const IntercomProviderMeta: CodeComponentMeta<IntercomProviderProps>;
14
14
  export declare function IntercomProvider({ apiBase, shouldInitialize, initializeDelay, workSpaceId, }: IntercomProviderProps): React.JSX.Element;
15
15
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"plasmic-intercom.cjs.development.js","sources":["../src/intercom.tsx","../src/index.tsx"],"sourcesContent":["import { ComponentMeta } from \"@plasmicapp/host\";\n\nimport React from \"react\";\nimport { IntercomProvider as Provider } from \"react-use-intercom\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-intercom\";\n\ninterface IntercomProviderProps {\n workSpaceId?: string;\n autoBoot?: boolean;\n buttonText?: string;\n shouldInitialize?: boolean;\n apiBase?: string;\n initializeDelay?: number;\n className?: string;\n}\nexport const IntercomProviderMeta: ComponentMeta<IntercomProviderProps> = {\n name: \"hostless-intercom\",\n displayName: \"Intercom Provider\",\n importName: \"IntercomProvider\",\n importPath: modulePath,\n providesData: true,\n props: {\n workSpaceId: {\n type: \"string\",\n displayName: \"Workspace ID\",\n description: \"ID of your workspace\",\n helpText:\n \"The easiest way to find your workspace ID is to check the URL of any page you have open in Intercom. It's the code that comes after apps/ in the URL.\",\n },\n shouldInitialize: {\n type: \"boolean\",\n displayName: \"Intercom Initialize\",\n description:\n \"indicates if the Intercom should be initialized. Can be used in multistaged environment\",\n },\n initializeDelay: {\n type: \"number\",\n displayName: \"Delay\",\n description:\n \"Indicates if the intercom initialization should be delayed, delay is in ms, defaults to 0\",\n },\n apiBase: {\n type: \"string\",\n displayName: \"Api Base\",\n description:\n \"If you need to route your Messenger requests through a different endpoint than the default. Generally speaking, this is not need\",\n },\n },\n};\n\nexport function IntercomProvider({\n apiBase,\n shouldInitialize,\n initializeDelay,\n workSpaceId,\n}: IntercomProviderProps) {\n if (!workSpaceId) {\n return <div>Please enter your Workspace ID</div>;\n }\n\n return (\n <Provider\n appId={workSpaceId}\n autoBoot\n apiBase={apiBase}\n shouldInitialize={shouldInitialize}\n initializeDelay={initializeDelay}\n ></Provider>\n );\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport { IntercomProvider, IntercomProviderMeta } from \"./intercom\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(IntercomProvider, IntercomProviderMeta);\n}\n\nexport * from \"./intercom\";\n"],"names":["ensure","x","undefined","Error","modulePath","IntercomProviderMeta","name","displayName","importName","importPath","providesData","props","workSpaceId","type","description","helpText","shouldInitialize","initializeDelay","apiBase","IntercomProvider","_ref","React","Provider","appId","autoBoot","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent"],"mappings":";;;;;;;;;;SAKgBA,MAAMA,CAAIC,CAAuB;EAC/C,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;IACjC;IACA,MAAM,IAAIC,KAAK,sCAAsC,CAAC;GACvD,MAAM;IACL,OAAOF,CAAC;;AAEZ;AAEA,IAAMG,UAAU,GAAG,+BAA+B;IAWrCC,oBAAoB,GAAyC;EACxEC,IAAI,EAAE,mBAAmB;EACzBC,WAAW,EAAE,mBAAmB;EAChCC,UAAU,EAAE,kBAAkB;EAC9BC,UAAU,EAAEL,UAAU;EACtBM,YAAY,EAAE,IAAI;EAClBC,KAAK,EAAE;IACLC,WAAW,EAAE;MACXC,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,cAAc;MAC3BO,WAAW,EAAE,sBAAsB;MACnCC,QAAQ,EACN;KACH;IACDC,gBAAgB,EAAE;MAChBH,IAAI,EAAE,SAAS;MACfN,WAAW,EAAE,qBAAqB;MAClCO,WAAW,EACT;KACH;IACDG,eAAe,EAAE;MACfJ,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,OAAO;MACpBO,WAAW,EACT;KACH;IACDI,OAAO,EAAE;MACPL,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,UAAU;MACvBO,WAAW,EACT;;;;SAKQK,gBAAgBA,CAAAC,IAAA;MAC9BF,OAAO,GAAAE,IAAA,CAAPF,OAAO;IACPF,gBAAgB,GAAAI,IAAA,CAAhBJ,gBAAgB;IAChBC,eAAe,GAAAG,IAAA,CAAfH,eAAe;IACfL,WAAW,GAAAQ,IAAA,CAAXR,WAAW;EAEX,IAAI,CAACA,WAAW,EAAE;IAChB,OAAOS,kEAAyC;;EAGlD,OACEA,oBAACC,iCAAQ;IACPC,KAAK,EAAEX,WAAW;IAClBY,QAAQ;IACRN,OAAO,EAAEA,OAAO;IAChBF,gBAAgB,EAAEA,gBAAgB;IAClCC,eAAe,EAAEA;IACP;AAEhB;;SCzEgBQ,WAAWA,CAACC,MAG3B;EACC,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CACtBC,SAAY,EACZC,WAAmD;IAEnD,IAAIH,MAAM,EAAE;MACVA,MAAM,CAACI,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;KACjD,MAAM;MACLC,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;;GAE5C;EAEDF,kBAAkB,CAACR,gBAAgB,EAAEd,oBAAoB,CAAC;AAC5D;;;;;;;"}
1
+ {"version":3,"file":"plasmic-intercom.cjs.development.js","sources":["../src/intercom.tsx","../src/index.tsx"],"sourcesContent":["import { CodeComponentMeta } from \"@plasmicapp/host/registerComponent\";\n\nimport React from \"react\";\nimport { IntercomProvider as Provider } from \"react-use-intercom\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-intercom\";\n\ninterface IntercomProviderProps {\n workSpaceId?: string;\n autoBoot?: boolean;\n buttonText?: string;\n shouldInitialize?: boolean;\n apiBase?: string;\n initializeDelay?: number;\n className?: string;\n}\nexport const IntercomProviderMeta: CodeComponentMeta<IntercomProviderProps> = {\n name: \"hostless-intercom\",\n displayName: \"Intercom Provider\",\n importName: \"IntercomProvider\",\n importPath: modulePath,\n providesData: true,\n props: {\n workSpaceId: {\n type: \"string\",\n displayName: \"Workspace ID\",\n description: \"ID of your workspace\",\n helpText:\n \"The easiest way to find your workspace ID is to check the URL of any page you have open in Intercom. It's the code that comes after apps/ in the URL.\",\n },\n shouldInitialize: {\n type: \"boolean\",\n displayName: \"Intercom Initialize\",\n description:\n \"indicates if the Intercom should be initialized. Can be used in multistaged environment\",\n },\n initializeDelay: {\n type: \"number\",\n displayName: \"Delay\",\n description:\n \"Indicates if the intercom initialization should be delayed, delay is in ms, defaults to 0\",\n },\n apiBase: {\n type: \"string\",\n displayName: \"Api Base\",\n description:\n \"If you need to route your Messenger requests through a different endpoint than the default. Generally speaking, this is not need\",\n },\n },\n};\n\nexport function IntercomProvider({\n apiBase,\n shouldInitialize,\n initializeDelay,\n workSpaceId,\n}: IntercomProviderProps) {\n if (!workSpaceId) {\n return <div>Please enter your Workspace ID</div>;\n }\n\n return (\n <Provider\n appId={workSpaceId}\n autoBoot\n apiBase={apiBase}\n shouldInitialize={shouldInitialize}\n initializeDelay={initializeDelay}\n ></Provider>\n );\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport { IntercomProvider, IntercomProviderMeta } from \"./intercom\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(IntercomProvider, IntercomProviderMeta);\n}\n\nexport * from \"./intercom\";\n"],"names":["ensure","x","undefined","Error","modulePath","IntercomProviderMeta","name","displayName","importName","importPath","providesData","props","workSpaceId","type","description","helpText","shouldInitialize","initializeDelay","apiBase","IntercomProvider","_ref","React","Provider","appId","autoBoot","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent"],"mappings":";;;;;;;;;;SAKgBA,MAAMA,CAAIC,CAAuB;EAC/C,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;IACjC;IACA,MAAM,IAAIC,KAAK,sCAAsC,CAAC;GACvD,MAAM;IACL,OAAOF,CAAC;;AAEZ;AAEA,IAAMG,UAAU,GAAG,+BAA+B;IAWrCC,oBAAoB,GAA6C;EAC5EC,IAAI,EAAE,mBAAmB;EACzBC,WAAW,EAAE,mBAAmB;EAChCC,UAAU,EAAE,kBAAkB;EAC9BC,UAAU,EAAEL,UAAU;EACtBM,YAAY,EAAE,IAAI;EAClBC,KAAK,EAAE;IACLC,WAAW,EAAE;MACXC,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,cAAc;MAC3BO,WAAW,EAAE,sBAAsB;MACnCC,QAAQ,EACN;KACH;IACDC,gBAAgB,EAAE;MAChBH,IAAI,EAAE,SAAS;MACfN,WAAW,EAAE,qBAAqB;MAClCO,WAAW,EACT;KACH;IACDG,eAAe,EAAE;MACfJ,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,OAAO;MACpBO,WAAW,EACT;KACH;IACDI,OAAO,EAAE;MACPL,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,UAAU;MACvBO,WAAW,EACT;;;;SAKQK,gBAAgBA,CAAAC,IAAA;MAC9BF,OAAO,GAAAE,IAAA,CAAPF,OAAO;IACPF,gBAAgB,GAAAI,IAAA,CAAhBJ,gBAAgB;IAChBC,eAAe,GAAAG,IAAA,CAAfH,eAAe;IACfL,WAAW,GAAAQ,IAAA,CAAXR,WAAW;EAEX,IAAI,CAACA,WAAW,EAAE;IAChB,OAAOS,kEAAyC;;EAGlD,OACEA,oBAACC,iCAAQ;IACPC,KAAK,EAAEX,WAAW;IAClBY,QAAQ;IACRN,OAAO,EAAEA,OAAO;IAChBF,gBAAgB,EAAEA,gBAAgB;IAClCC,eAAe,EAAEA;IACP;AAEhB;;SCzEgBQ,WAAWA,CAACC,MAG3B;EACC,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CACtBC,SAAY,EACZC,WAAuD;IAEvD,IAAIH,MAAM,EAAE;MACVA,MAAM,CAACI,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;KACjD,MAAM;MACLC,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;;GAE5C;EAEDF,kBAAkB,CAACR,gBAAgB,EAAEd,oBAAoB,CAAC;AAC5D;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"plasmic-intercom.cjs.production.min.js","sources":["../src/intercom.tsx","../src/index.tsx"],"sourcesContent":["import { ComponentMeta } from \"@plasmicapp/host\";\n\nimport React from \"react\";\nimport { IntercomProvider as Provider } from \"react-use-intercom\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-intercom\";\n\ninterface IntercomProviderProps {\n workSpaceId?: string;\n autoBoot?: boolean;\n buttonText?: string;\n shouldInitialize?: boolean;\n apiBase?: string;\n initializeDelay?: number;\n className?: string;\n}\nexport const IntercomProviderMeta: ComponentMeta<IntercomProviderProps> = {\n name: \"hostless-intercom\",\n displayName: \"Intercom Provider\",\n importName: \"IntercomProvider\",\n importPath: modulePath,\n providesData: true,\n props: {\n workSpaceId: {\n type: \"string\",\n displayName: \"Workspace ID\",\n description: \"ID of your workspace\",\n helpText:\n \"The easiest way to find your workspace ID is to check the URL of any page you have open in Intercom. It's the code that comes after apps/ in the URL.\",\n },\n shouldInitialize: {\n type: \"boolean\",\n displayName: \"Intercom Initialize\",\n description:\n \"indicates if the Intercom should be initialized. Can be used in multistaged environment\",\n },\n initializeDelay: {\n type: \"number\",\n displayName: \"Delay\",\n description:\n \"Indicates if the intercom initialization should be delayed, delay is in ms, defaults to 0\",\n },\n apiBase: {\n type: \"string\",\n displayName: \"Api Base\",\n description:\n \"If you need to route your Messenger requests through a different endpoint than the default. Generally speaking, this is not need\",\n },\n },\n};\n\nexport function IntercomProvider({\n apiBase,\n shouldInitialize,\n initializeDelay,\n workSpaceId,\n}: IntercomProviderProps) {\n if (!workSpaceId) {\n return <div>Please enter your Workspace ID</div>;\n }\n\n return (\n <Provider\n appId={workSpaceId}\n autoBoot\n apiBase={apiBase}\n shouldInitialize={shouldInitialize}\n initializeDelay={initializeDelay}\n ></Provider>\n );\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport { IntercomProvider, IntercomProviderMeta } from \"./intercom\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(IntercomProvider, IntercomProviderMeta);\n}\n\nexport * from \"./intercom\";\n"],"names":["IntercomProviderMeta","name","displayName","importName","importPath","providesData","props","workSpaceId","type","description","helpText","shouldInitialize","initializeDelay","apiBase","IntercomProvider","_ref","React","Provider","appId","autoBoot","x","Error","loader","Component","defaultMeta","registerComponent"],"mappings":"uPAyBaA,EAA6D,CACxEC,KAAM,oBACNC,YAAa,oBACbC,WAAY,mBACZC,WAfiB,gCAgBjBC,cAAc,EACdC,MAAO,CACLC,YAAa,CACXC,KAAM,SACNN,YAAa,eACbO,YAAa,uBACbC,SACE,yJAEJC,iBAAkB,CAChBH,KAAM,UACNN,YAAa,sBACbO,YACE,2FAEJG,gBAAiB,CACfJ,KAAM,SACNN,YAAa,QACbO,YACE,6FAEJI,QAAS,CACPL,KAAM,SACNN,YAAa,WACbO,YACE,+IAKQK,EAAgBC,OAI9BR,EAAWQ,EAAXR,YAEA,OAAKA,EAKHS,gBAACC,oBACCC,MAAOX,EACPY,YACAN,QAbGE,EAAPF,QAcIF,iBAbYI,EAAhBJ,iBAcIC,gBAbWG,EAAfH,kBAISI,+IA9DeI,GACxB,GAAIA,MAAAA,EAEF,MAAM,IAAIC,6CAEV,OAAOD,gCCJiBE,GAI1B,IACEC,EACAC,EADAD,EAUiBT,EATjBU,EASmCxB,EAP/BsB,EACFA,EAAOG,kBAAkBF,EAAWC,GAEpCC,EAAkBF,EAAWC"}
1
+ {"version":3,"file":"plasmic-intercom.cjs.production.min.js","sources":["../src/intercom.tsx","../src/index.tsx"],"sourcesContent":["import { CodeComponentMeta } from \"@plasmicapp/host/registerComponent\";\n\nimport React from \"react\";\nimport { IntercomProvider as Provider } from \"react-use-intercom\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-intercom\";\n\ninterface IntercomProviderProps {\n workSpaceId?: string;\n autoBoot?: boolean;\n buttonText?: string;\n shouldInitialize?: boolean;\n apiBase?: string;\n initializeDelay?: number;\n className?: string;\n}\nexport const IntercomProviderMeta: CodeComponentMeta<IntercomProviderProps> = {\n name: \"hostless-intercom\",\n displayName: \"Intercom Provider\",\n importName: \"IntercomProvider\",\n importPath: modulePath,\n providesData: true,\n props: {\n workSpaceId: {\n type: \"string\",\n displayName: \"Workspace ID\",\n description: \"ID of your workspace\",\n helpText:\n \"The easiest way to find your workspace ID is to check the URL of any page you have open in Intercom. It's the code that comes after apps/ in the URL.\",\n },\n shouldInitialize: {\n type: \"boolean\",\n displayName: \"Intercom Initialize\",\n description:\n \"indicates if the Intercom should be initialized. Can be used in multistaged environment\",\n },\n initializeDelay: {\n type: \"number\",\n displayName: \"Delay\",\n description:\n \"Indicates if the intercom initialization should be delayed, delay is in ms, defaults to 0\",\n },\n apiBase: {\n type: \"string\",\n displayName: \"Api Base\",\n description:\n \"If you need to route your Messenger requests through a different endpoint than the default. Generally speaking, this is not need\",\n },\n },\n};\n\nexport function IntercomProvider({\n apiBase,\n shouldInitialize,\n initializeDelay,\n workSpaceId,\n}: IntercomProviderProps) {\n if (!workSpaceId) {\n return <div>Please enter your Workspace ID</div>;\n }\n\n return (\n <Provider\n appId={workSpaceId}\n autoBoot\n apiBase={apiBase}\n shouldInitialize={shouldInitialize}\n initializeDelay={initializeDelay}\n ></Provider>\n );\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport { IntercomProvider, IntercomProviderMeta } from \"./intercom\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(IntercomProvider, IntercomProviderMeta);\n}\n\nexport * from \"./intercom\";\n"],"names":["IntercomProviderMeta","name","displayName","importName","importPath","providesData","props","workSpaceId","type","description","helpText","shouldInitialize","initializeDelay","apiBase","IntercomProvider","_ref","React","Provider","appId","autoBoot","x","Error","loader","Component","defaultMeta","registerComponent"],"mappings":"uPAyBaA,EAAiE,CAC5EC,KAAM,oBACNC,YAAa,oBACbC,WAAY,mBACZC,WAfiB,gCAgBjBC,cAAc,EACdC,MAAO,CACLC,YAAa,CACXC,KAAM,SACNN,YAAa,eACbO,YAAa,uBACbC,SACE,yJAEJC,iBAAkB,CAChBH,KAAM,UACNN,YAAa,sBACbO,YACE,2FAEJG,gBAAiB,CACfJ,KAAM,SACNN,YAAa,QACbO,YACE,6FAEJI,QAAS,CACPL,KAAM,SACNN,YAAa,WACbO,YACE,+IAKQK,EAAgBC,OAI9BR,EAAWQ,EAAXR,YAEA,OAAKA,EAKHS,gBAACC,oBACCC,MAAOX,EACPY,YACAN,QAbGE,EAAPF,QAcIF,iBAbYI,EAAhBJ,iBAcIC,gBAbWG,EAAfH,kBAISI,+IA9DeI,GACxB,GAAIA,MAAAA,EAEF,MAAM,IAAIC,6CAEV,OAAOD,gCCJiBE,GAI1B,IACEC,EACAC,EADAD,EAUiBT,EATjBU,EASmCxB,EAP/BsB,EACFA,EAAOG,kBAAkBF,EAAWC,GAEpCC,EAAkBF,EAAWC"}
@@ -1 +1 @@
1
- {"version":3,"file":"plasmic-intercom.esm.js","sources":["../src/intercom.tsx","../src/index.tsx"],"sourcesContent":["import { ComponentMeta } from \"@plasmicapp/host\";\n\nimport React from \"react\";\nimport { IntercomProvider as Provider } from \"react-use-intercom\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-intercom\";\n\ninterface IntercomProviderProps {\n workSpaceId?: string;\n autoBoot?: boolean;\n buttonText?: string;\n shouldInitialize?: boolean;\n apiBase?: string;\n initializeDelay?: number;\n className?: string;\n}\nexport const IntercomProviderMeta: ComponentMeta<IntercomProviderProps> = {\n name: \"hostless-intercom\",\n displayName: \"Intercom Provider\",\n importName: \"IntercomProvider\",\n importPath: modulePath,\n providesData: true,\n props: {\n workSpaceId: {\n type: \"string\",\n displayName: \"Workspace ID\",\n description: \"ID of your workspace\",\n helpText:\n \"The easiest way to find your workspace ID is to check the URL of any page you have open in Intercom. It's the code that comes after apps/ in the URL.\",\n },\n shouldInitialize: {\n type: \"boolean\",\n displayName: \"Intercom Initialize\",\n description:\n \"indicates if the Intercom should be initialized. Can be used in multistaged environment\",\n },\n initializeDelay: {\n type: \"number\",\n displayName: \"Delay\",\n description:\n \"Indicates if the intercom initialization should be delayed, delay is in ms, defaults to 0\",\n },\n apiBase: {\n type: \"string\",\n displayName: \"Api Base\",\n description:\n \"If you need to route your Messenger requests through a different endpoint than the default. Generally speaking, this is not need\",\n },\n },\n};\n\nexport function IntercomProvider({\n apiBase,\n shouldInitialize,\n initializeDelay,\n workSpaceId,\n}: IntercomProviderProps) {\n if (!workSpaceId) {\n return <div>Please enter your Workspace ID</div>;\n }\n\n return (\n <Provider\n appId={workSpaceId}\n autoBoot\n apiBase={apiBase}\n shouldInitialize={shouldInitialize}\n initializeDelay={initializeDelay}\n ></Provider>\n );\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport { IntercomProvider, IntercomProviderMeta } from \"./intercom\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(IntercomProvider, IntercomProviderMeta);\n}\n\nexport * from \"./intercom\";\n"],"names":["ensure","x","undefined","Error","modulePath","IntercomProviderMeta","name","displayName","importName","importPath","providesData","props","workSpaceId","type","description","helpText","shouldInitialize","initializeDelay","apiBase","IntercomProvider","_ref","React","Provider","appId","autoBoot","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent"],"mappings":";;;;SAKgBA,MAAMA,CAAIC,CAAuB;EAC/C,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;IACjC;IACA,MAAM,IAAIC,KAAK,sCAAsC,CAAC;GACvD,MAAM;IACL,OAAOF,CAAC;;AAEZ;AAEA,IAAMG,UAAU,GAAG,+BAA+B;IAWrCC,oBAAoB,GAAyC;EACxEC,IAAI,EAAE,mBAAmB;EACzBC,WAAW,EAAE,mBAAmB;EAChCC,UAAU,EAAE,kBAAkB;EAC9BC,UAAU,EAAEL,UAAU;EACtBM,YAAY,EAAE,IAAI;EAClBC,KAAK,EAAE;IACLC,WAAW,EAAE;MACXC,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,cAAc;MAC3BO,WAAW,EAAE,sBAAsB;MACnCC,QAAQ,EACN;KACH;IACDC,gBAAgB,EAAE;MAChBH,IAAI,EAAE,SAAS;MACfN,WAAW,EAAE,qBAAqB;MAClCO,WAAW,EACT;KACH;IACDG,eAAe,EAAE;MACfJ,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,OAAO;MACpBO,WAAW,EACT;KACH;IACDI,OAAO,EAAE;MACPL,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,UAAU;MACvBO,WAAW,EACT;;;;SAKQK,gBAAgBA,CAAAC,IAAA;MAC9BF,OAAO,GAAAE,IAAA,CAAPF,OAAO;IACPF,gBAAgB,GAAAI,IAAA,CAAhBJ,gBAAgB;IAChBC,eAAe,GAAAG,IAAA,CAAfH,eAAe;IACfL,WAAW,GAAAQ,IAAA,CAAXR,WAAW;EAEX,IAAI,CAACA,WAAW,EAAE;IAChB,OAAOS,kEAAyC;;EAGlD,OACEA,oBAACC,kBAAQ;IACPC,KAAK,EAAEX,WAAW;IAClBY,QAAQ;IACRN,OAAO,EAAEA,OAAO;IAChBF,gBAAgB,EAAEA,gBAAgB;IAClCC,eAAe,EAAEA;IACP;AAEhB;;SCzEgBQ,WAAWA,CAACC,MAG3B;EACC,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CACtBC,SAAY,EACZC,WAAmD;IAEnD,IAAIH,MAAM,EAAE;MACVA,MAAM,CAACI,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;KACjD,MAAM;MACLC,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;;GAE5C;EAEDF,kBAAkB,CAACR,gBAAgB,EAAEd,oBAAoB,CAAC;AAC5D;;;;"}
1
+ {"version":3,"file":"plasmic-intercom.esm.js","sources":["../src/intercom.tsx","../src/index.tsx"],"sourcesContent":["import { CodeComponentMeta } from \"@plasmicapp/host/registerComponent\";\n\nimport React from \"react\";\nimport { IntercomProvider as Provider } from \"react-use-intercom\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-intercom\";\n\ninterface IntercomProviderProps {\n workSpaceId?: string;\n autoBoot?: boolean;\n buttonText?: string;\n shouldInitialize?: boolean;\n apiBase?: string;\n initializeDelay?: number;\n className?: string;\n}\nexport const IntercomProviderMeta: CodeComponentMeta<IntercomProviderProps> = {\n name: \"hostless-intercom\",\n displayName: \"Intercom Provider\",\n importName: \"IntercomProvider\",\n importPath: modulePath,\n providesData: true,\n props: {\n workSpaceId: {\n type: \"string\",\n displayName: \"Workspace ID\",\n description: \"ID of your workspace\",\n helpText:\n \"The easiest way to find your workspace ID is to check the URL of any page you have open in Intercom. It's the code that comes after apps/ in the URL.\",\n },\n shouldInitialize: {\n type: \"boolean\",\n displayName: \"Intercom Initialize\",\n description:\n \"indicates if the Intercom should be initialized. Can be used in multistaged environment\",\n },\n initializeDelay: {\n type: \"number\",\n displayName: \"Delay\",\n description:\n \"Indicates if the intercom initialization should be delayed, delay is in ms, defaults to 0\",\n },\n apiBase: {\n type: \"string\",\n displayName: \"Api Base\",\n description:\n \"If you need to route your Messenger requests through a different endpoint than the default. Generally speaking, this is not need\",\n },\n },\n};\n\nexport function IntercomProvider({\n apiBase,\n shouldInitialize,\n initializeDelay,\n workSpaceId,\n}: IntercomProviderProps) {\n if (!workSpaceId) {\n return <div>Please enter your Workspace ID</div>;\n }\n\n return (\n <Provider\n appId={workSpaceId}\n autoBoot\n apiBase={apiBase}\n shouldInitialize={shouldInitialize}\n initializeDelay={initializeDelay}\n ></Provider>\n );\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport { IntercomProvider, IntercomProviderMeta } from \"./intercom\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(IntercomProvider, IntercomProviderMeta);\n}\n\nexport * from \"./intercom\";\n"],"names":["ensure","x","undefined","Error","modulePath","IntercomProviderMeta","name","displayName","importName","importPath","providesData","props","workSpaceId","type","description","helpText","shouldInitialize","initializeDelay","apiBase","IntercomProvider","_ref","React","Provider","appId","autoBoot","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent"],"mappings":";;;;SAKgBA,MAAMA,CAAIC,CAAuB;EAC/C,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;IACjC;IACA,MAAM,IAAIC,KAAK,sCAAsC,CAAC;GACvD,MAAM;IACL,OAAOF,CAAC;;AAEZ;AAEA,IAAMG,UAAU,GAAG,+BAA+B;IAWrCC,oBAAoB,GAA6C;EAC5EC,IAAI,EAAE,mBAAmB;EACzBC,WAAW,EAAE,mBAAmB;EAChCC,UAAU,EAAE,kBAAkB;EAC9BC,UAAU,EAAEL,UAAU;EACtBM,YAAY,EAAE,IAAI;EAClBC,KAAK,EAAE;IACLC,WAAW,EAAE;MACXC,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,cAAc;MAC3BO,WAAW,EAAE,sBAAsB;MACnCC,QAAQ,EACN;KACH;IACDC,gBAAgB,EAAE;MAChBH,IAAI,EAAE,SAAS;MACfN,WAAW,EAAE,qBAAqB;MAClCO,WAAW,EACT;KACH;IACDG,eAAe,EAAE;MACfJ,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,OAAO;MACpBO,WAAW,EACT;KACH;IACDI,OAAO,EAAE;MACPL,IAAI,EAAE,QAAQ;MACdN,WAAW,EAAE,UAAU;MACvBO,WAAW,EACT;;;;SAKQK,gBAAgBA,CAAAC,IAAA;MAC9BF,OAAO,GAAAE,IAAA,CAAPF,OAAO;IACPF,gBAAgB,GAAAI,IAAA,CAAhBJ,gBAAgB;IAChBC,eAAe,GAAAG,IAAA,CAAfH,eAAe;IACfL,WAAW,GAAAQ,IAAA,CAAXR,WAAW;EAEX,IAAI,CAACA,WAAW,EAAE;IAChB,OAAOS,kEAAyC;;EAGlD,OACEA,oBAACC,kBAAQ;IACPC,KAAK,EAAEX,WAAW;IAClBY,QAAQ;IACRN,OAAO,EAAEA,OAAO;IAChBF,gBAAgB,EAAEA,gBAAgB;IAClCC,eAAe,EAAEA;IACP;AAEhB;;SCzEgBQ,WAAWA,CAACC,MAG3B;EACC,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CACtBC,SAAY,EACZC,WAAuD;IAEvD,IAAIH,MAAM,EAAE;MACVA,MAAM,CAACI,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;KACjD,MAAM;MACLC,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;;GAE5C;EAEDF,kBAAkB,CAACR,gBAAgB,EAAEd,oBAAoB,CAAC;AAC5D;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/plasmic-intercom",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Plasmic intercom components.",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -34,7 +34,7 @@
34
34
  }
35
35
  ],
36
36
  "devDependencies": {
37
- "@plasmicapp/host": "1.0.233",
37
+ "@plasmicapp/host": "1.0.234",
38
38
  "@types/react": "^17.0.43",
39
39
  "@types/react-dom": "^17.0.14",
40
40
  "husky": "^7.0.4",
@@ -46,5 +46,5 @@
46
46
  "dependencies": {
47
47
  "react-use-intercom": "^2.0.0"
48
48
  },
49
- "gitHead": "592d26e3b6a7199b682855fba6458851a37d7e3d"
49
+ "gitHead": "bbba4b6636e69a3441c6dbe4cefb860ed30e826f"
50
50
  }