@plaidev/karte-action-sdk 1.1.48 → 1.1.49

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.
@@ -338,22 +338,6 @@ declare function showOnTime<Props extends {
338
338
  show_on_time: boolean;
339
339
  show_on_time_count: number;
340
340
  }>(props: Props, fn?: Function): () => void;
341
- type ComponentOptions<Data> = {
342
- target: ShadowRoot | HTMLElement;
343
- props?: {
344
- send?: Function;
345
- close?: () => void;
346
- data?: Data;
347
- };
348
- hydrate?: boolean;
349
- };
350
- declare const createApp: <Props, Variables>(App: (arg: ComponentOptions<Props & Variables>) => void, props?: Props, options?: {
351
- send: Function;
352
- variables: Variables;
353
- }) => {
354
- close: () => void;
355
- showApp: () => void;
356
- };
357
341
  declare function ensureModalRoot(useShadow?: boolean): ShadowRoot | HTMLElement;
358
342
  declare const h: (type: string, props: any, ...children: Array<any>) => HTMLElement;
359
343
  declare function createFog({ color, opacity, zIndex, onclick }: {
@@ -380,7 +364,7 @@ declare const collection: (config: {
380
364
  } | null | undefined, cb: (err: Error | null, items?: any) => void): void;
381
365
  set(key: string, value: string, cb: (err: Error | null) => void): void;
382
366
  };
383
- export { state, closed, maximumZindex, initialize, finalize, send_event, isPreview, setMiximumZindex, none, moveTo, linkTo, closeApp, execOnClickOperation, handleFocus, setPreviousFocus, handleKeydown, getPositionStyle, getMarginStyle, onScroll, onTime, hasSuffix, toBr, randStr, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, AnimationStyleTranslations, ModalPositions, ModalPosition, ModalPositionTranslations, ModalMarginTranslations, ModalMargin, ModalPlacement, DefaultModalPlacement, Operation, OnClickOperationOptions, OnClickOperation, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, Repeats, Repeat, BackgroundSizes, BackgroundSize, Style, StateName, hideOnScroll, hideOnTime, showOnScroll, showOnTime, createApp, ensureModalRoot, h, createFog, EmbedLogic, embed, collection };
367
+ export { state, closed, maximumZindex, initialize, finalize, send_event, isPreview, setMiximumZindex, none, moveTo, linkTo, closeApp, execOnClickOperation, handleFocus, setPreviousFocus, handleKeydown, getPositionStyle, getMarginStyle, onScroll, onTime, hasSuffix, toBr, randStr, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, AnimationStyleTranslations, ModalPositions, ModalPosition, ModalPositionTranslations, ModalMarginTranslations, ModalMargin, ModalPlacement, DefaultModalPlacement, Operation, OnClickOperationOptions, OnClickOperation, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, Repeats, Repeat, BackgroundSizes, BackgroundSize, Style, StateName, hideOnScroll, hideOnTime, showOnScroll, showOnTime, ensureModalRoot, h, createFog, EmbedLogic, embed, collection };
384
368
  export { default as State } from './components/State.svelte';
385
369
  export { default as StateItem } from './components/StateItem.svelte';
386
370
  export { default as Modal } from './components/Modal.svelte';
@@ -125,7 +125,7 @@ const send_event = (event_name, values) => {
125
125
  options?.send?.(event_name, values);
126
126
  };
127
127
  const isPreview = () => {
128
- return typeof process !== 'undefined' && process.env.true === 'true';
128
+ return typeof process !== 'undefined' && process.env.IS_PREVIEW === 'true';
129
129
  };
130
130
  const setMiximumZindex = (zindex) => {
131
131
  if (!zindex || zindex < get(maximumZindex))
@@ -367,40 +367,6 @@ function showOnTime(props, fn) {
367
367
  }
368
368
 
369
369
  const KARTE_MODAL_ROOT = 'karte-modal-root';
370
- const createApp = (App, props, options) => {
371
- let app = null;
372
- const close = () => {
373
- if (app) {
374
- app.$destory();
375
- app = null;
376
- }
377
- };
378
- const appArgs = {
379
- target: null,
380
- props: {
381
- send: options.send,
382
- close,
383
- data: {
384
- ...props,
385
- ...options.variables,
386
- },
387
- },
388
- };
389
- {
390
- const win = ensureModalRoot(false);
391
- appArgs.target = win;
392
- appArgs.hydrate = true;
393
- }
394
- return {
395
- close,
396
- showApp: () => {
397
- if (app) {
398
- return;
399
- }
400
- app = new App(appArgs);
401
- },
402
- };
403
- };
404
370
  function ensureModalRoot(useShadow = true) {
405
371
  let el = document.getElementById(KARTE_MODAL_ROOT);
406
372
  if (el == null) {
@@ -2569,4 +2535,4 @@ class ImageBlock extends SvelteComponent {
2569
2535
  }
2570
2536
  }
2571
2537
 
2572
- export { Alignments, AnimationStyleTranslations, AnimationStyles, BackgroundSizes, DefaultModalPlacement, Directions, Flex, FlexItem, Grid, GridItem, GridModalState, ImageBlock, Justifies, LengthUnits, MediaQueries, Modal, ModalMarginTranslations, ModalPositionTranslations, ModalPositions, ObjectFits, OnClickOperationOptions, PropTypes, Repeats, State, StateItem, TextBlock, TextButtonBlock, closeApp, closed, collection, createApp, createFog, embed, ensureModalRoot, execOnClickOperation, finalize, getMarginStyle, getPositionStyle, h, handleFocus, handleKeydown, hasSuffix, hideOnScroll, hideOnTime, initialize, isPreview, linkTo, maximumZindex, moveTo, none, onScroll, onTime, randStr, send_event, setMiximumZindex, setPreviousFocus, showOnScroll, showOnTime, state, toBr };
2538
+ export { Alignments, AnimationStyleTranslations, AnimationStyles, BackgroundSizes, DefaultModalPlacement, Directions, Flex, FlexItem, Grid, GridItem, GridModalState, ImageBlock, Justifies, LengthUnits, MediaQueries, Modal, ModalMarginTranslations, ModalPositionTranslations, ModalPositions, ObjectFits, OnClickOperationOptions, PropTypes, Repeats, State, StateItem, TextBlock, TextButtonBlock, closeApp, closed, collection, createFog, embed, ensureModalRoot, execOnClickOperation, finalize, getMarginStyle, getPositionStyle, h, handleFocus, handleKeydown, hasSuffix, hideOnScroll, hideOnTime, initialize, isPreview, linkTo, maximumZindex, moveTo, none, onScroll, onTime, randStr, send_event, setMiximumZindex, setPreviousFocus, showOnScroll, showOnTime, state, toBr };
@@ -338,22 +338,6 @@ declare function showOnTime<Props extends {
338
338
  show_on_time: boolean;
339
339
  show_on_time_count: number;
340
340
  }>(props: Props, fn?: Function): () => void;
341
- type ComponentOptions<Data> = {
342
- target: ShadowRoot | HTMLElement;
343
- props?: {
344
- send?: Function;
345
- close?: () => void;
346
- data?: Data;
347
- };
348
- hydrate?: boolean;
349
- };
350
- declare const createApp: <Props, Variables>(App: (arg: ComponentOptions<Props & Variables>) => void, props?: Props, options?: {
351
- send: Function;
352
- variables: Variables;
353
- }) => {
354
- close: () => void;
355
- showApp: () => void;
356
- };
357
341
  declare function ensureModalRoot(useShadow?: boolean): ShadowRoot | HTMLElement;
358
342
  declare const h: (type: string, props: any, ...children: Array<any>) => HTMLElement;
359
343
  declare function createFog({ color, opacity, zIndex, onclick }: {
@@ -380,7 +364,7 @@ declare const collection: (config: {
380
364
  } | null | undefined, cb: (err: Error | null, items?: any) => void): void;
381
365
  set(key: string, value: string, cb: (err: Error | null) => void): void;
382
366
  };
383
- export { state, closed, maximumZindex, initialize, finalize, send_event, isPreview, setMiximumZindex, none, moveTo, linkTo, closeApp, execOnClickOperation, handleFocus, setPreviousFocus, handleKeydown, getPositionStyle, getMarginStyle, onScroll, onTime, hasSuffix, toBr, randStr, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, AnimationStyleTranslations, ModalPositions, ModalPosition, ModalPositionTranslations, ModalMarginTranslations, ModalMargin, ModalPlacement, DefaultModalPlacement, Operation, OnClickOperationOptions, OnClickOperation, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, Repeats, Repeat, BackgroundSizes, BackgroundSize, Style, StateName, hideOnScroll, hideOnTime, showOnScroll, showOnTime, createApp, ensureModalRoot, h, createFog, EmbedLogic, embed, collection };
367
+ export { state, closed, maximumZindex, initialize, finalize, send_event, isPreview, setMiximumZindex, none, moveTo, linkTo, closeApp, execOnClickOperation, handleFocus, setPreviousFocus, handleKeydown, getPositionStyle, getMarginStyle, onScroll, onTime, hasSuffix, toBr, randStr, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, AnimationStyleTranslations, ModalPositions, ModalPosition, ModalPositionTranslations, ModalMarginTranslations, ModalMargin, ModalPlacement, DefaultModalPlacement, Operation, OnClickOperationOptions, OnClickOperation, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, Repeats, Repeat, BackgroundSizes, BackgroundSize, Style, StateName, hideOnScroll, hideOnTime, showOnScroll, showOnTime, ensureModalRoot, h, createFog, EmbedLogic, embed, collection };
384
368
  export { default as State } from './components/State.svelte';
385
369
  export { default as StateItem } from './components/StateItem.svelte';
386
370
  export { default as Modal } from './components/Modal.svelte';
package/dist/index.es.js CHANGED
@@ -125,7 +125,7 @@ const send_event = (event_name, values) => {
125
125
  options?.send?.(event_name, values);
126
126
  };
127
127
  const isPreview = () => {
128
- return typeof process !== 'undefined' && process.env.false === 'true';
128
+ return typeof process !== 'undefined' && process.env.IS_PREVIEW === 'true';
129
129
  };
130
130
  const setMiximumZindex = (zindex) => {
131
131
  if (!zindex || zindex < get(maximumZindex))
@@ -367,39 +367,6 @@ function showOnTime(props, fn) {
367
367
  }
368
368
 
369
369
  const KARTE_MODAL_ROOT = 'karte-modal-root';
370
- const createApp = (App, props, options) => {
371
- let app = null;
372
- const close = () => {
373
- if (app) {
374
- app.$destory();
375
- app = null;
376
- }
377
- };
378
- const appArgs = {
379
- target: null,
380
- props: {
381
- send: options.send,
382
- close,
383
- data: {
384
- ...props,
385
- ...options.variables,
386
- },
387
- },
388
- };
389
- {
390
- const win = ensureModalRoot(true);
391
- appArgs.target = win;
392
- }
393
- return {
394
- close,
395
- showApp: () => {
396
- if (app) {
397
- return;
398
- }
399
- app = new App(appArgs);
400
- },
401
- };
402
- };
403
370
  function ensureModalRoot(useShadow = true) {
404
371
  let el = document.getElementById(KARTE_MODAL_ROOT);
405
372
  if (el == null) {
@@ -2384,4 +2351,4 @@ class ImageBlock extends SvelteComponent {
2384
2351
  }
2385
2352
  }
2386
2353
 
2387
- export { Alignments, AnimationStyleTranslations, AnimationStyles, BackgroundSizes, DefaultModalPlacement, Directions, Flex, FlexItem, Grid, GridItem, GridModalState, ImageBlock, Justifies, LengthUnits, MediaQueries, Modal, ModalMarginTranslations, ModalPositionTranslations, ModalPositions, ObjectFits, OnClickOperationOptions, PropTypes, Repeats, State, StateItem, TextBlock, TextButtonBlock, closeApp, closed, collection, createApp, createFog, embed, ensureModalRoot, execOnClickOperation, finalize, getMarginStyle, getPositionStyle, h, handleFocus, handleKeydown, hasSuffix, hideOnScroll, hideOnTime, initialize, isPreview, linkTo, maximumZindex, moveTo, none, onScroll, onTime, randStr, send_event, setMiximumZindex, setPreviousFocus, showOnScroll, showOnTime, state, toBr };
2354
+ export { Alignments, AnimationStyleTranslations, AnimationStyles, BackgroundSizes, DefaultModalPlacement, Directions, Flex, FlexItem, Grid, GridItem, GridModalState, ImageBlock, Justifies, LengthUnits, MediaQueries, Modal, ModalMarginTranslations, ModalPositionTranslations, ModalPositions, ObjectFits, OnClickOperationOptions, PropTypes, Repeats, State, StateItem, TextBlock, TextButtonBlock, closeApp, closed, collection, createFog, embed, ensureModalRoot, execOnClickOperation, finalize, getMarginStyle, getPositionStyle, h, handleFocus, handleKeydown, hasSuffix, hideOnScroll, hideOnTime, initialize, isPreview, linkTo, maximumZindex, moveTo, none, onScroll, onTime, randStr, send_event, setMiximumZindex, setPreviousFocus, showOnScroll, showOnTime, state, toBr };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.48",
3
+ "version": "1.1.49",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",