@makeswift/runtime 0.8.6 → 0.8.8
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.
- package/dist/LiveProvider.cjs.js +4 -3
- package/dist/LiveProvider.cjs.js.map +1 -1
- package/dist/LiveProvider.es.js +5 -4
- package/dist/LiveProvider.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +4 -3
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +5 -4
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/actions.es.js +1 -1
- package/dist/constants.cjs.js +6 -2
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.es.js +8 -4
- package/dist/constants.es.js.map +1 -1
- package/dist/index.cjs.js +83 -50
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs5.js +260 -106
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.es.js +86 -52
- package/dist/index.es.js.map +1 -1
- package/dist/index.es5.js +260 -106
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es7.js +1 -1
- package/dist/index.es7.js.map +1 -1
- package/dist/leaf.es.js +1 -1
- package/dist/next.es.js +1 -1
- package/dist/state/breakpoints.cjs.js +44 -10
- package/dist/state/breakpoints.cjs.js.map +1 -1
- package/dist/state/breakpoints.es.js +44 -10
- package/dist/state/breakpoints.es.js.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
- package/dist/types/src/next/api-handler/handlers/manifest.d.ts +1 -0
- package/dist/types/src/next/api-handler/handlers/manifest.d.ts.map +1 -1
- package/dist/types/src/next/client.d.ts +4 -1
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/next/index.d.ts +3 -1
- package/dist/types/src/next/index.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/components/LiveProvider.d.ts +3 -1
- package/dist/types/src/runtimes/react/components/LiveProvider.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts +3 -1
- package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts +19 -5
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/clearBlockKeyForDevice.d.ts +2 -2
- package/dist/types/src/slate/BlockPlugin/clearBlockKeyForDevice.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/index.d.ts +4 -0
- package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts +7 -4
- package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/types.d.ts +2 -2
- package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts +4 -0
- package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts +4 -0
- package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts.map +1 -0
- package/dist/types/src/slate/ListPlugin/toggleList.d.ts +2 -1
- package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +1 -1
- package/dist/types/src/slate/ListPlugin/unwrapList.d.ts +6 -2
- package/dist/types/src/slate/ListPlugin/unwrapList.d.ts.map +1 -1
- package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts +0 -1
- package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts.map +1 -1
- package/dist/types/src/slate/ListPlugin/wrapList.d.ts +2 -1
- package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts +6 -2
- package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts +6 -2
- package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +6 -2
- package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts +6 -2
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts +6 -2
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
- package/dist/types/src/slate/selectors.d.ts +19 -0
- package/dist/types/src/slate/selectors.d.ts.map +1 -0
- package/dist/types/src/slate/utils/editor.d.ts.map +1 -1
- package/dist/types/src/slate/utils/element.d.ts +2 -1
- package/dist/types/src/slate/utils/element.d.ts.map +1 -1
- package/dist/types/src/slate/utils/unhangRange.d.ts +10 -0
- package/dist/types/src/slate/utils/unhangRange.d.ts.map +1 -0
- package/dist/types/src/state/modules/breakpoints.d.ts +3 -4
- package/dist/types/src/state/modules/breakpoints.d.ts.map +1 -1
- package/dist/types/src/state/modules/breakpoints.test.d.ts +2 -0
- package/dist/types/src/state/modules/breakpoints.test.d.ts.map +1 -0
- package/dist/types/src/state/react-page.d.ts +2 -1
- package/dist/types/src/state/react-page.d.ts.map +1 -1
- package/dist/types/src/utils/isNonNullable.d.ts +2 -0
- package/dist/types/src/utils/isNonNullable.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoints.es.js","sources":["../../src/utils/keys.ts","../../src/utils/coalesce.ts","../../src/utils/shallowMerge.ts","../../src/state/modules/breakpoints.ts"],"sourcesContent":["const keys = <O extends { [key: string]: unknown }>(o: O): (keyof O)[] => Object.keys(o)\n\nexport default keys\n","const coalesce = <T>(...args: Array<T>): T => {\n let i: number\n\n for (i = 0; i < args.length - 1; i += 1) {\n if (args[i] != null) return args[i]\n }\n\n return args[i]\n}\n\nexport default coalesce\n","import keys from './keys'\nimport coalesce from './coalesce'\n\nexport default function shallowMerge<\n A extends Record<string, unknown>,\n B extends Record<string, unknown>,\n>(a: A, b: B): A & B {\n const bKeys = keys(b)\n const merged = { ...a } as A & B\n\n bKeys.forEach(key => {\n // @ts-expect-error: `coalesce` returns `null | undefined` regardless of input guarantees.\n merged[key] = coalesce(merged[key], b[key])\n })\n\n return merged\n}\n","import { Viewport } from 'csstype'\n\nimport {\n ResponsiveValue as PropControllerResponsiveValue,\n DeviceOverride as PropControllerDeviceOverride,\n Device as DeviceId,\n} from '../../prop-controllers'\nimport shallowMerge from '../../utils/shallowMerge'\nimport { Action, ActionTypes } from '../actions'\n\nexport type DeviceOverride<T> = PropControllerDeviceOverride<T>\nexport type ResponsiveValue<T> = PropControllerResponsiveValue<T>\nexport type BreakpointId = DeviceId\n\nexport type Breakpoint = {\n id: BreakpointId\n label: string\n viewportWidth?: number\n minWidth?: number\n maxWidth?: number\n}\n\nexport type Breakpoints = Breakpoint[]\n\nexport type State = Breakpoints\n\nexport const DefaultBreakpointID = {\n Desktop: 'desktop',\n Tablet: 'tablet',\n Mobile: 'mobile',\n} as const\n\ntype DefaultBreakpointID = typeof DefaultBreakpointID[keyof typeof DefaultBreakpointID]\n\nexport const DEFAULT_BREAKPOINTS: Breakpoints = [\n {\n id: DefaultBreakpointID.Desktop,\n label: 'Desktop',\n minWidth: 769,\n },\n {\n id: DefaultBreakpointID.Tablet,\n label: 'Tablet',\n minWidth: 576,\n maxWidth: 768,\n viewportWidth: 760,\n },\n {\n id: DefaultBreakpointID.Mobile,\n label: 'Mobile',\n maxWidth: 575,\n viewportWidth: 390,\n },\n]\n\nexport function getInitialState(): State {\n return DEFAULT_BREAKPOINTS\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.SET_BREAKPOINTS: {\n const breakpoints = action.payload.breakpoints\n\n if (breakpoints.length === 0) throw new Error('Breakpoints cannot be empty.')\n\n return breakpoints\n }\n\n default:\n return state\n }\n}\n\nexport type BreakpointsInput = Record<\n string,\n { label?: string; min?: number; max?: number; viewport?: number }\n>\n\nexport function parseBreakpointsInput(input: BreakpointsInput): Breakpoints {\n const breakpoints = Object.entries(input).map(([id, { label, min, max, viewport }]) => ({\n id,\n label: label ?? id,\n minWidth: min,\n maxWidth: max,\n viewportWidth: viewport,\n }))\n\n return sortBreakpoints(breakpoints)\n}\n\n// Sort breakpoints by minWidth in descending order\nfunction sortBreakpoints(breakpoints: Breakpoints): Breakpoints {\n return breakpoints.sort((a, b) => (b?.minWidth ?? 0) - (a?.minWidth ?? 0))\n}\n\nexport const getBreakpoint = (state: State, breakpointId: Breakpoint['id']): Breakpoint => {\n const breakpoint = state.find(({ id }) => id === breakpointId)\n\n if (breakpoint == null) throw new Error(`Unrecognized breakpoint ID: \"${breakpointId}\".`)\n\n return breakpoint\n}\n\nexport const getBaseBreakpoint = (breakpoints: Breakpoints): Breakpoint => {\n const breakpoint = sortBreakpoints(breakpoints)[0]\n\n if (breakpoint == null) throw new Error(`Cannot get base breakpoint.`)\n\n return breakpoint\n}\n\nexport function findBreakpointOverride<S>(\n breakpoints: Breakpoints,\n values: ResponsiveValue<S> = [],\n deviceId: string,\n strategy: FallbackStrategy<S> = defaultStrategy,\n): DeviceOverride<S> | undefined {\n const value = values.find(({ deviceId: d }) => d === deviceId)\n const fallbacks = breakpoints\n .slice(0, breakpoints.findIndex(d => d.id === deviceId) + 1)\n .reverse()\n .map(d => values.find(v => v.deviceId === d.id))\n .filter((override): override is DeviceOverride<S> => Boolean(override))\n\n return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : undefined\n}\n\nexport type FallbackStrategy<V> = (\n arg0: DeviceOverride<V> | undefined,\n arg1: ResponsiveValue<V>,\n) => DeviceOverride<V> | undefined\n\nfunction defaultStrategy<V>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return value || fallbacks[0]\n}\n\nexport function shallowMergeFallbacks<V extends Record<string, unknown>>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return [value, ...fallbacks]\n .filter((override): override is DeviceOverride<V> => Boolean(override))\n .reduce((a, b) => ({\n deviceId: a.deviceId || b.deviceId,\n value: shallowMerge(a.value, b.value),\n }))\n}\n\nexport type ExtractResponsiveValue<T> = T extends ResponsiveValue<infer V> ? V : never\n\nexport function join<V, A extends ReadonlyArray<ResponsiveValue<V> | null | undefined>, R>(\n breakpoints: Breakpoints,\n responsiveValues: A,\n joinFn: (values: { [I in keyof A]: ExtractResponsiveValue<A[I]> | undefined }) => R,\n strategy?: FallbackStrategy<V>,\n): ResponsiveValue<R> {\n return breakpoints\n .map(({ id }) => id)\n .map(deviceId => {\n const value = joinFn(\n responsiveValues.map(responsiveValue => {\n const deviceValue =\n responsiveValue &&\n findBreakpointOverride(breakpoints, responsiveValue, deviceId, strategy)\n\n return deviceValue == null ? undefined : deviceValue.value\n }) as unknown as { [I in keyof A]: ExtractResponsiveValue<A[I] | undefined> },\n )\n\n if (value == null) return null\n\n return { deviceId, value }\n })\n .filter((override): override is DeviceOverride<R> => Boolean(override))\n}\n\nexport const getBreakpointMediaQuery = (breakpoint: Breakpoint): string => {\n const parts = ['@media only screen']\n\n if (breakpoint.minWidth != null) {\n parts.push(`(min-width: ${breakpoint.minWidth}px)`)\n }\n\n if (breakpoint.maxWidth != null) {\n parts.push(`(max-width: ${breakpoint.maxWidth}px)`)\n }\n\n return parts.join(' and ')\n}\n\nexport const getViewportStyle = (\n state: State,\n deviceId: string,\n): Viewport<string | number> | null | undefined => {\n const device = getBreakpoint(state, deviceId)\n\n return (\n device && {\n width: device.viewportWidth != null ? device.viewportWidth : '100%',\n minWidth: device.minWidth,\n }\n )\n}\n\nexport function findNextFallback<V>(\n breakpoints: Breakpoints,\n value: ResponsiveValue<V>,\n deviceId: BreakpointId,\n activeDeviceId: BreakpointId,\n fallbackStrategy?: FallbackStrategy<V>,\n): Breakpoint | null {\n const deviceOverride = findBreakpointOverride(\n breakpoints,\n value.filter(v => v.deviceId !== activeDeviceId),\n deviceId,\n fallbackStrategy,\n )\n\n return (deviceOverride && getBreakpoint(breakpoints, deviceOverride.deviceId)) ?? null\n}\n\nexport const mergeResponsiveValues = <A>(\n breakpoints: Breakpoints,\n source: DeviceOverride<A>[],\n override: DeviceOverride<A>[],\n): DeviceOverride<A>[] => {\n const devices = [\n ...new Set(\n source.map(({ deviceId }) => deviceId).concat(override.map(({ deviceId }) => deviceId)),\n ),\n ]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findBreakpointOverride(breakpoints, source, deviceId) || { value: {} }).value,\n ...(findBreakpointOverride(breakpoints, override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,OAAO,CAAuC,MAAsB,OAAO,KAAK,CAAC;ACAvF,MAAM,WAAW,IAAO,SAAsB;AACxC,MAAA;AAEJ,OAAK,IAAI,GAAG,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG;AACvC,QAAI,KAAK,MAAM;AAAM,aAAO,KAAK;AAAA,EACnC;AAEA,SAAO,KAAK;AACd;ACLA,sBAGE,GAAM,GAAa;AACb,QAAA,QAAQ,KAAK,CAAC;AACd,QAAA,SAAS,mBAAK;AAEpB,QAAM,QAAQ,CAAO,QAAA;AAEnB,WAAO,OAAO,SAAS,OAAO,MAAM,EAAE,IAAI;AAAA,EAAA,CAC3C;AAEM,SAAA;AACT;ACUO,MAAM,sBAAsB;AAAA,EACjC,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AACV;AAIO,MAAM,sBAAmC;AAAA,EAC9C;AAAA,IACE,IAAI,oBAAoB;AAAA,IACxB,O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KAAK,eAAe,WAAW,aAAa;AAAA,EACpD;AAEI,MAAA,WAAW,YAAY,MAAM;AACzB,UAAA,KAAK,eAAe,WAAW,aAAa;AAAA,EACpD;AAEO,SAAA,MAAM,KAAK,OAAO;AAC3B;AAEa,MAAA,mBAAmB,CAC9B,OACA,aACiD;AAC3C,QAAA,SAAS,cAAc,OAAO,QAAQ;AAE5C,SACE,UAAU;AAAA,IACR,OAAO,OAAO,iBAAiB,OAAO,OAAO,gBAAgB;AAAA,IAC7D,UAAU,OAAO;AAAA,EAAA;AAGvB;AAEO,0BACL,aACA,OACA,UACA,gBACA,kBACmB;;AACb,QAAA,iBAAiB,uBACrB,aACA,MAAM,OAAO,CAAK,MAAA,EAAE,aAAa,cAAc,GAC/C,UACA,gBACF;AAEA,SAA0B,wBAAA,cAAc,aAAa,eAAe,QAAQ,MAAlD,YAAwD;AACpF;AAEO,MAAM,wBAAwB,CACnC,aACA,QACA,aACwB;AACxB,QAAM,UAAU;AAAA,IACd,GAAG,IAAI,IACL,OAAO,IAAI,CAAC,EAAE,eAAe,QAAQ,EAAE,OAAO,SAAS,IAAI,CAAC,EAAE,eAAe,QAAQ,CAAC,CACxF;AAAA,EAAA;AAGK,SAAA,QAAQ,IAAI,CAAa,aAAA;AAAA,IAC9B;AAAA,IACA,OAAO,kCACD,wBAAuB,aAAa,QAAQ,QAAQ,KAAK,EAAE,OAAO,CAAC,EAAA,GAAK,QACxE,wBAAuB,aAAa,UAAU,UAAU,CAAA,MAAK,CAAC,KAAK,EAAE,OAAO,CAAA,EAAM,GAAA;AAAA,EAExF,EAAA;AACJ;;"}
|
|
1
|
+
{"version":3,"file":"breakpoints.es.js","sources":["../../src/utils/keys.ts","../../src/utils/coalesce.ts","../../src/utils/shallowMerge.ts","../../src/state/modules/breakpoints.ts"],"sourcesContent":["const keys = <O extends { [key: string]: unknown }>(o: O): (keyof O)[] => Object.keys(o)\n\nexport default keys\n","const coalesce = <T>(...args: Array<T>): T => {\n let i: number\n\n for (i = 0; i < args.length - 1; i += 1) {\n if (args[i] != null) return args[i]\n }\n\n return args[i]\n}\n\nexport default coalesce\n","import keys from './keys'\nimport coalesce from './coalesce'\n\nexport default function shallowMerge<\n A extends Record<string, unknown>,\n B extends Record<string, unknown>,\n>(a: A, b: B): A & B {\n const bKeys = keys(b)\n const merged = { ...a } as A & B\n\n bKeys.forEach(key => {\n // @ts-expect-error: `coalesce` returns `null | undefined` regardless of input guarantees.\n merged[key] = coalesce(merged[key], b[key])\n })\n\n return merged\n}\n","import { Viewport } from 'csstype'\n\nimport {\n ResponsiveValue as PropControllerResponsiveValue,\n DeviceOverride as PropControllerDeviceOverride,\n Device as DeviceId,\n} from '../../prop-controllers'\nimport shallowMerge from '../../utils/shallowMerge'\nimport { Action, ActionTypes } from '../actions'\n\nexport type DeviceOverride<T> = PropControllerDeviceOverride<T>\nexport type ResponsiveValue<T> = PropControllerResponsiveValue<T>\nexport type BreakpointId = DeviceId\n\nexport type Breakpoint = {\n id: BreakpointId\n label?: string\n viewportWidth?: number\n minWidth?: number\n maxWidth?: number\n}\n\nexport type Breakpoints = Breakpoint[]\n\nexport type State = Breakpoints\n\nexport const DefaultBreakpointID = {\n Desktop: 'desktop',\n Tablet: 'tablet',\n Mobile: 'mobile',\n} as const\n\ntype DefaultBreakpointID = typeof DefaultBreakpointID[keyof typeof DefaultBreakpointID]\n\nexport const DEFAULT_BREAKPOINTS: Breakpoints = [\n {\n id: DefaultBreakpointID.Desktop,\n label: 'Desktop',\n minWidth: 769,\n },\n {\n id: DefaultBreakpointID.Tablet,\n label: 'Tablet',\n minWidth: 576,\n maxWidth: 768,\n viewportWidth: 760,\n },\n {\n id: DefaultBreakpointID.Mobile,\n label: 'Mobile',\n maxWidth: 575,\n viewportWidth: 390,\n },\n]\n\nexport function getInitialState(breakpoints = DEFAULT_BREAKPOINTS): State {\n return breakpoints\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.SET_BREAKPOINTS: {\n const breakpoints = action.payload.breakpoints\n\n if (breakpoints.length === 0) throw new Error('Breakpoints cannot be empty.')\n\n return breakpoints\n }\n\n default:\n return state\n }\n}\n\nexport type BreakpointsInput = Record<string, { width: number; label?: string; viewport?: number }>\n\nexport function parseBreakpointsInput(input: BreakpointsInput): Breakpoints {\n validateBreakpointsInput(input)\n\n const sorted = Object.entries(input)\n .map(([id, value]) => ({ ...value, id }))\n .sort((a, b) => b.width - a.width) // Sort by width in descending order\n\n const transformed = sorted.reduce(\n (prev, curr, index, array) => {\n const { width, viewport, id, label } = curr\n const next = array[index + 1]\n\n const breakpoint: Breakpoint = {\n id,\n ...(label && { label }),\n ...(next && { minWidth: next.width + 1 }),\n maxWidth: width,\n viewportWidth: viewport ?? width,\n }\n\n return [...prev, breakpoint]\n },\n [\n { id: DefaultBreakpointID.Desktop, label: 'Desktop', minWidth: sorted[0].width + 1 },\n ] as Breakpoints,\n )\n\n return transformed\n}\n\nfunction validateBreakpointsInput(input: BreakpointsInput) {\n if (DefaultBreakpointID.Desktop in input) {\n throw new Error(\n `Cannot change the base breakpoint. \"${DefaultBreakpointID.Desktop}\" is reserved as the base breakpoint.`,\n )\n }\n\n if (Object.keys(input).length === 0) {\n throw new Error(`Breakpoints cannot be empty. You must provide at least one breakpoint.`)\n }\n\n const sorted = Object.entries(input)\n .map(([id, value]) => ({ ...value, id }))\n .sort((a, b) => b.width - a.width) // Sort by width in descending order\n\n sorted.forEach(({ id, width, viewport }, index, array) => {\n // This is only valid for desktop-first. We need to check the inverse for mobile-first.\n if (viewport && viewport > width) {\n throw new Error(\n `Error on breakpoint \"${id}\". Viewport cannot be greater than its width.\n \"${id}\" has a viewport of ${viewport}px and a width of ${width}px.`,\n )\n }\n\n const next = array[index + 1]\n\n if (viewport && next && viewport < next.width) {\n throw new Error(\n `Error on breakpoint \"${id}\". Viewport cannot be smaller than the next breakpoint's width. \n \"${id}\" has a viewport of ${viewport}px and the next breakpoint \"${next.id}\" has a width of ${next.width}px.`,\n )\n }\n\n if (next && width === next.width) {\n throw new Error(\n `Breakpoints cannot have the same width. \"${id}\" and \"${next.id}\" have the same width`,\n )\n }\n })\n}\n\n// Sort breakpoints by minWidth in descending order\nfunction sortBreakpoints(breakpoints: Breakpoints): Breakpoints {\n return breakpoints.sort((a, b) => (b?.minWidth ?? 0) - (a?.minWidth ?? 0))\n}\n\nexport const getBreakpoint = (state: State, breakpointId: Breakpoint['id']): Breakpoint => {\n const breakpoint = state.find(({ id }) => id === breakpointId)\n\n if (breakpoint == null) throw new Error(`Unrecognized breakpoint ID: \"${breakpointId}\".`)\n\n return breakpoint\n}\n\nexport const getBaseBreakpoint = (breakpoints: Breakpoints): Breakpoint => {\n const breakpoint = sortBreakpoints(breakpoints)[0]\n\n if (breakpoint == null) throw new Error(`Cannot get base breakpoint.`)\n\n return breakpoint\n}\n\nexport function findBreakpointOverride<S>(\n breakpoints: Breakpoints,\n values: ResponsiveValue<S> = [],\n deviceId: string,\n strategy: FallbackStrategy<S> = defaultStrategy,\n): DeviceOverride<S> | undefined {\n const value = values.find(({ deviceId: d }) => d === deviceId)\n const fallbacks = breakpoints\n .slice(0, breakpoints.findIndex(d => d.id === deviceId) + 1)\n .reverse()\n .map(d => values.find(v => v.deviceId === d.id))\n .filter((override): override is DeviceOverride<S> => Boolean(override))\n\n return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : undefined\n}\n\nexport type FallbackStrategy<V> = (\n arg0: DeviceOverride<V> | undefined,\n arg1: ResponsiveValue<V>,\n) => DeviceOverride<V> | undefined\n\nfunction defaultStrategy<V>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return value || fallbacks[0]\n}\n\nexport function shallowMergeFallbacks<V extends Record<string, unknown>>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return [value, ...fallbacks]\n .filter((override): override is DeviceOverride<V> => Boolean(override))\n .reduce((a, b) => ({\n deviceId: a.deviceId || b.deviceId,\n value: shallowMerge(a.value, b.value),\n }))\n}\n\nexport type ExtractResponsiveValue<T> = T extends ResponsiveValue<infer V> ? V : never\n\nexport function join<V, A extends ReadonlyArray<ResponsiveValue<V> | null | undefined>, R>(\n breakpoints: Breakpoints,\n responsiveValues: A,\n joinFn: (values: { [I in keyof A]: ExtractResponsiveValue<A[I]> | undefined }) => R,\n strategy?: FallbackStrategy<V>,\n): ResponsiveValue<R> {\n return breakpoints\n .map(({ id }) => id)\n .map(deviceId => {\n const value = joinFn(\n responsiveValues.map(responsiveValue => {\n const deviceValue =\n responsiveValue &&\n findBreakpointOverride(breakpoints, responsiveValue, deviceId, strategy)\n\n return deviceValue == null ? undefined : deviceValue.value\n }) as unknown as { [I in keyof A]: ExtractResponsiveValue<A[I] | undefined> },\n )\n\n if (value == null) return null\n\n return { deviceId, value }\n })\n .filter((override): override is DeviceOverride<R> => Boolean(override))\n}\n\nexport const getBreakpointMediaQuery = (breakpoint: Breakpoint): string => {\n const parts = ['@media only screen']\n\n if (breakpoint.minWidth != null) {\n parts.push(`(min-width: ${breakpoint.minWidth}px)`)\n }\n\n if (breakpoint.maxWidth != null) {\n parts.push(`(max-width: ${breakpoint.maxWidth}px)`)\n }\n\n return parts.join(' and ')\n}\n\nexport const getViewportStyle = (\n state: State,\n deviceId: string,\n): Viewport<string | number> | null | undefined => {\n const device = getBreakpoint(state, deviceId)\n\n return (\n device && {\n width: device.viewportWidth != null ? device.viewportWidth : '100%',\n minWidth: device.minWidth,\n }\n )\n}\n\nexport function findNextFallback<V>(\n breakpoints: Breakpoints,\n value: ResponsiveValue<V>,\n deviceId: BreakpointId,\n activeDeviceId: BreakpointId,\n fallbackStrategy?: FallbackStrategy<V>,\n): Breakpoint | null {\n const deviceOverride = findBreakpointOverride(\n breakpoints,\n value.filter(v => v.deviceId !== activeDeviceId),\n deviceId,\n fallbackStrategy,\n )\n\n return (deviceOverride && getBreakpoint(breakpoints, deviceOverride.deviceId)) ?? null\n}\n\nexport const mergeResponsiveValues = <A>(\n breakpoints: Breakpoints,\n source: DeviceOverride<A>[],\n override: DeviceOverride<A>[],\n): DeviceOverride<A>[] => {\n const devices = [\n ...new Set(\n source.map(({ deviceId }) => deviceId).concat(override.map(({ deviceId }) => deviceId)),\n ),\n ]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findBreakpointOverride(breakpoints, source, deviceId) || { value: {} }).value,\n ...(findBreakpointOverride(breakpoints, override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,OAAO,CAAuC,MAAsB,OAAO,KAAK,CAAC;ACAvF,MAAM,WAAW,IAAO,SAAsB;AACxC,MAAA;AAEJ,OAAK,IAAI,GAAG,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG;AACvC,QAAI,KAAK,MAAM;AAAM,aAAO,KAAK;AAAA,EACnC;AAEA,SAAO,KAAK;AACd;ACLA,sBAGE,GAAM,GAAa;AACb,QAAA,QAAQ,KAAK,CAAC;AACd,QAAA,SAAS,mBAAK;AAEpB,QAAM,QAAQ,CAAO,QAAA;AAEnB,WAAO,OAAO,SAAS,OAAO,MAAM,EAAE,IAAI;AAAA,EAAA,CAC3C;AAEM,SAAA;AACT;ACUO,MAAM,sBAAsB;AAAA,EACjC,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AACV;AAIO,MAAM,sBAAmC;AAAA,EAC9C;AAAA,IACE,IAAI,oBAAoB;AAAA,IACxB,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,IAAI,oBAAoB;AAAA,IACxB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,UAAU;AAAA,IACV,eAAe;AAAA,EACjB;AAAA,EACA;AAAA,IACE,IAAI,oBAAoB;AAAA,IACxB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,eAAe;AAAA,EACjB;AACF;AAEO,yB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SACE,UAAU;AAAA,IACR,OAAO,OAAO,iBAAiB,OAAO,OAAO,gBAAgB;AAAA,IAC7D,UAAU,OAAO;AAAA,EAAA;AAGvB;AAEO,0BACL,aACA,OACA,UACA,gBACA,kBACmB;;AACb,QAAA,iBAAiB,uBACrB,aACA,MAAM,OAAO,CAAK,MAAA,EAAE,aAAa,cAAc,GAC/C,UACA,gBACF;AAEA,SAA0B,wBAAA,cAAc,aAAa,eAAe,QAAQ,MAAlD,YAAwD;AACpF;AAEO,MAAM,wBAAwB,CACnC,aACA,QACA,aACwB;AACxB,QAAM,UAAU;AAAA,IACd,GAAG,IAAI,IACL,OAAO,IAAI,CAAC,EAAE,eAAe,QAAQ,EAAE,OAAO,SAAS,IAAI,CAAC,EAAE,eAAe,QAAQ,CAAC,CACxF;AAAA,EAAA;AAGK,SAAA,QAAQ,IAAI,CAAa,aAAA;AAAA,IAC9B;AAAA,IACA,OAAO,kCACD,wBAAuB,aAAa,QAAQ,QAAQ,KAAK,EAAE,OAAO,CAAC,EAAA,GAAK,QACxE,wBAAuB,aAAa,UAAU,UAAU,CAAA,MAAK,CAAC,KAAK,EAAE,OAAO,CAAA,EAAM,GAAA;AAAA,EAExF,EAAA;AACJ;;"}
|
package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ declare type BaseProps = {
|
|
|
8
8
|
};
|
|
9
9
|
declare const _default: import("react").ForwardRefExoticComponent<BaseProps & Omit<Pick<Partial<Pick<FormContextValue, "size" | "contrast" | "brandColor">> & {
|
|
10
10
|
error?: boolean | undefined;
|
|
11
|
-
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "size" | "error" | "contrast" | "brandColor"> & import("react").RefAttributes<HTMLInputElement>, "type" | "property" | "key" | "is" | "id" | "color" | "height" | "translate" | "width" | "style" | "value" | "children" | "
|
|
11
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "size" | "error" | "contrast" | "brandColor"> & import("react").RefAttributes<HTMLInputElement>, "type" | "property" | "key" | "is" | "id" | "color" | "height" | "translate" | "width" | "style" | "value" | "children" | "name" | "size" | "hidden" | "defaultValue" | "min" | "max" | "step" | "resource" | "form" | "slot" | "title" | "pattern" | "error" | "dir" | "list" | "itemProp" | "dangerouslySetInnerHTML" | "crossOrigin" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "multiple" | "disabled" | "alt" | "src" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "accept" | "autoComplete" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "readOnly" | "required" | "contrast" | "brandColor">, keyof BaseProps> & import("react").RefAttributes<HTMLInputElement>>;
|
|
12
12
|
export default _default;
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../../../src/next/api-handler/handlers/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AAGtD,oBAAY,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,gBAAgB,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../../../src/next/api-handler/handlers/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AAGtD,oBAAY,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,gBAAgB,EAAE,OAAO,CAAA;IACzB,iBAAiB,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,aAAK,aAAa,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAExC,oBAAY,gBAAgB,GAAG,QAAQ,GAAG,aAAa,CAAA;AAEvD,wBAA8B,OAAO,CACnC,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,eAAe,CAAC,gBAAgB,CAAC,EACtC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CAaf"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { File, GlobalElement, PagePathnameSlice, Swatch, Table, Typography } from '../api';
|
|
2
2
|
import { CacheData } from '../api/react';
|
|
3
|
+
import { ReactRuntime } from '../runtimes/react';
|
|
3
4
|
import { Element } from '../state/react-page';
|
|
4
5
|
export declare type MakeswiftPage = {
|
|
5
6
|
id: string;
|
|
@@ -55,12 +56,14 @@ declare type Seo = {
|
|
|
55
56
|
};
|
|
56
57
|
declare type MakeswiftConfig = {
|
|
57
58
|
apiOrigin?: string;
|
|
59
|
+
runtime?: ReactRuntime;
|
|
58
60
|
};
|
|
59
61
|
export declare class Makeswift {
|
|
60
62
|
private apiKey;
|
|
61
63
|
private apiOrigin;
|
|
62
64
|
private graphqlClient;
|
|
63
|
-
|
|
65
|
+
private runtime;
|
|
66
|
+
constructor(apiKey: string, { apiOrigin, runtime }?: MakeswiftConfig);
|
|
64
67
|
private fetch;
|
|
65
68
|
getPages(params?: {
|
|
66
69
|
path?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/next/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EACJ,aAAa,EACb,iBAAiB,EACjB,MAAM,EACN,KAAK,EACL,UAAU,EACX,MAAM,QAAQ,CAAA;AA8Bf,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/next/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EACJ,aAAa,EACb,iBAAiB,EACjB,MAAM,EACN,KAAK,EACL,UAAU,EACX,MAAM,QAAQ,CAAA;AA8Bf,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAYxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EACL,OAAO,EAIR,MAAM,qBAAqB,CAAA;AAE5B,oBAAY,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,oBAAY,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IACpB,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,IAAI,EAAE,IAAI,CAAA;IACV,GAAG,EAAE,GAAG,CAAA;CACT,CAAA;AAED,oBAAY,qBAAqB,GAAG;IAClC,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,SAAS,CAAA;IACpB,OAAO,EAAE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,EAAE,SAAuC,EAAE,OAAO,EAAE,GAAE,eAAoB;YAwB9D,KAAK;IASb,QAAQ,CAAC,MAAM,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;YAa1D,eAAe;YASf,wBAAwB;YAWxB,UAAU;YAoKV,cAAc;YASd,uBAAuB;IAkB/B,eAAe,CACnB,IAAI,EAAE,MAAM,EACZ,EAAE,OAAO,EAAE,GAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAO,GACtC,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAUlC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IASnD,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAS7C,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAS/D,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IASxE,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IASvE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAQvD"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ReactRuntime } from '../runtimes/react';
|
|
2
3
|
import { MakeswiftPageSnapshot } from './client';
|
|
3
4
|
export declare type PageProps = {
|
|
4
5
|
snapshot: MakeswiftPageSnapshot;
|
|
6
|
+
runtime?: ReactRuntime;
|
|
5
7
|
};
|
|
6
8
|
import { GetServerSidePropsContext, GetServerSidePropsResult, GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult } from 'next';
|
|
7
9
|
import { MakeswiftPreviewData } from './preview-mode';
|
|
@@ -13,7 +15,7 @@ export declare function getStaticProps(ctx: GetStaticPropsContext<ParsedUrlQuery
|
|
|
13
15
|
export declare function getServerSideProps(ctx: GetServerSidePropsContext<{
|
|
14
16
|
path?: string[];
|
|
15
17
|
}>): Promise<GetServerSidePropsResult<PageProps>>;
|
|
16
|
-
export declare const Page: import("react").MemoExoticComponent<({ snapshot }: PageProps) => JSX.Element>;
|
|
18
|
+
export declare const Page: import("react").MemoExoticComponent<({ snapshot, runtime }: PageProps) => JSX.Element>;
|
|
17
19
|
export * from './client';
|
|
18
20
|
export * from './preview-mode';
|
|
19
21
|
export * from './document';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/next/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/next/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAmB,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEhD,oBAAY,SAAS,GAAG;IACtB,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB,CAAA;AACD,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AA6CrD,aAAK,cAAc,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAUzC,wBAAsB,cAAc,IAAI,OAAO,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC,CAYpF;AAID,wBAAsB,cAAc,CAClC,GAAG,EAAE,qBAAqB,CAAC,cAAc,EAAE,oBAAoB,CAAC,GAC/D,OAAO,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAY1C;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,yBAAyB,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,GAClD,OAAO,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,CAU9C;AAED,eAAO,MAAM,IAAI,8DAAgC,SAAS,iBAqBxD,CAAA;AAEF,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactRuntime } from '..';
|
|
2
3
|
import * as ReactPage from '../../../state/react-page';
|
|
3
4
|
import { MakeswiftClient } from '../../../api/react';
|
|
4
5
|
declare type Props = {
|
|
5
6
|
client: MakeswiftClient;
|
|
6
7
|
rootElements?: Map<string, ReactPage.Element>;
|
|
7
8
|
children?: ReactNode;
|
|
9
|
+
runtime?: ReactRuntime;
|
|
8
10
|
};
|
|
9
|
-
export default function LiveProvider({ client, children, rootElements }: Props): JSX.Element;
|
|
11
|
+
export default function LiveProvider({ client, children, rootElements, runtime, }: Props): JSX.Element;
|
|
10
12
|
export {};
|
|
11
13
|
//# sourceMappingURL=LiveProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/runtimes/react/components/LiveProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"LiveProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/runtimes/react/components/LiveProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,OAAO,CAAA;AAE1C,OAAO,EAAgB,YAAY,EAAE,MAAM,IAAI,CAAA;AAC/C,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAqB,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEvE,aAAK,KAAK,GAAG;IACX,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC7C,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,OAAO,GACR,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAerB"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactRuntime } from '..';
|
|
2
3
|
import * as ReactPage from '../../../state/react-page';
|
|
3
4
|
import { MakeswiftClient } from '../../../api/react';
|
|
4
5
|
declare type Props = {
|
|
5
6
|
client: MakeswiftClient;
|
|
6
7
|
rootElements?: Map<string, ReactPage.Element>;
|
|
7
8
|
children?: ReactNode;
|
|
9
|
+
runtime?: ReactRuntime;
|
|
8
10
|
};
|
|
9
|
-
export default function PreviewProvider({ client, children, rootElements }: Props): JSX.Element;
|
|
11
|
+
export default function PreviewProvider({ client, children, rootElements, runtime, }: Props): JSX.Element;
|
|
10
12
|
export {};
|
|
11
13
|
//# sourceMappingURL=PreviewProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/runtimes/react/components/PreviewProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"PreviewProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/runtimes/react/components/PreviewProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,OAAO,CAAA;AAErD,OAAO,EAAgB,YAAY,EAAE,MAAM,IAAI,CAAA;AAE/C,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAqB,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGvE,aAAK,KAAK,GAAG;IACX,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC7C,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,OAAO,GACR,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA6BrB"}
|
|
@@ -7,11 +7,23 @@ import { MakeswiftClient } from '../../api/react';
|
|
|
7
7
|
import { ElementImperativeHandle } from './element-imperative-handle';
|
|
8
8
|
import { BuilderEditMode } from '../../state/modules/builder-edit-mode';
|
|
9
9
|
import { Breakpoints, BreakpointsInput } from '../../state/modules/breakpoints';
|
|
10
|
-
export declare
|
|
11
|
-
|
|
10
|
+
export declare class ReactRuntime {
|
|
11
|
+
static store: ReactPage.Store;
|
|
12
|
+
static registerComponent<P extends Record<string, PropControllerDescriptor>, C extends ReactPage.ComponentType<{
|
|
13
|
+
[K in keyof P]: PropControllerDescriptorValueType<P[K]>;
|
|
14
|
+
}>>(component: C, { type, label, icon, hidden, props, }: {
|
|
15
|
+
type: string;
|
|
16
|
+
label: string;
|
|
17
|
+
icon?: ComponentIcon;
|
|
18
|
+
hidden?: boolean;
|
|
19
|
+
props?: P;
|
|
20
|
+
}): () => void;
|
|
21
|
+
static copyElementTree(elementTree: ReactPage.ElementData, replacementContext: ReactPage.SerializableReplacementContext): ReactPage.Element;
|
|
22
|
+
static getBreakpoints(): Breakpoints;
|
|
23
|
+
store: ReactPage.Store;
|
|
12
24
|
registerComponent<P extends Record<string, PropControllerDescriptor>, C extends ReactPage.ComponentType<{
|
|
13
25
|
[K in keyof P]: PropControllerDescriptorValueType<P[K]>;
|
|
14
|
-
}>>(component: C,
|
|
26
|
+
}>>(component: C, { type, label, icon, hidden, props, }: {
|
|
15
27
|
type: string;
|
|
16
28
|
label: string;
|
|
17
29
|
icon?: ComponentIcon;
|
|
@@ -20,15 +32,17 @@ export interface ReactRuntime {
|
|
|
20
32
|
}): () => void;
|
|
21
33
|
copyElementTree(elementTree: ReactPage.ElementData, replacementContext: ReactPage.SerializableReplacementContext): ReactPage.Element;
|
|
22
34
|
getBreakpoints(): Breakpoints;
|
|
23
|
-
|
|
35
|
+
constructor({ breakpoints }: {
|
|
36
|
+
breakpoints?: BreakpointsInput;
|
|
37
|
+
});
|
|
24
38
|
}
|
|
25
|
-
export declare const ReactRuntime: ReactRuntime;
|
|
26
39
|
export declare const StoreContext: import("react").Context<ReactPage.Store>;
|
|
27
40
|
declare type RuntimeProviderProps = {
|
|
28
41
|
client: MakeswiftClient;
|
|
29
42
|
preview: boolean;
|
|
30
43
|
rootElements?: Map<string, ReactPage.Element>;
|
|
31
44
|
children?: ReactNode;
|
|
45
|
+
runtime?: ReactRuntime;
|
|
32
46
|
};
|
|
33
47
|
export declare function RuntimeProvider({ preview, ...props }: RuntimeProviderProps): JSX.Element;
|
|
34
48
|
declare const PageContext: import("react").Context<string | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EAIxB,SAAS,EASV,MAAM,OAAO,CAAA;AAId,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,KAAK,mBAAmB,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/index.tsx"],"names":[],"mappings":"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C;AAED,aAAK,iBAAiB,GAAG;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,wBAAwB,CAAC,OAAO,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;CAC/E,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,iBAAiB,eAE/D;AAID,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAE9C;AAYD,aAAK,KAAK,GAAG,SAAS,CAAC,KAAK,GAAG,mBAAmB,CAAC,KAAK,CAAA;AAExD,wBAAgB,QAAQ,IAAI,SAAS,CAAC,KAAK,CAE1C;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,CAI/D;AAMD,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAQjF;AAMD,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D;AAED,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAkHD,aAAK,YAAY,GAAG;IAClB,OAAO,EAAE,SAAS,CAAC,OAAO,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,OAAO,iNAgDnB,CAAA;AAmBD,aAAK,sBAAsB,GAAG;IAC5B,iBAAiB,EAAE,SAAS,CAAC,iBAAiB,CAAA;CAC/C,CAAA;AAED,eAAO,MAAM,iBAAiB,2NAa7B,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
import { Device } from '../../controls/types';
|
|
3
2
|
import { EditableBlockKey } from './types';
|
|
4
|
-
|
|
3
|
+
import { BreakpointId } from '../../state/modules/breakpoints';
|
|
4
|
+
export declare function clearBlockKeyForDevice(editor: Editor, deviceId: BreakpointId, key: EditableBlockKey): void;
|
|
5
5
|
//# sourceMappingURL=clearBlockKeyForDevice.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearBlockKeyForDevice.d.ts","sourceRoot":"","sources":["../../../../../src/slate/BlockPlugin/clearBlockKeyForDevice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"clearBlockKeyForDevice.d.ts","sourceRoot":"","sources":["../../../../../src/slate/BlockPlugin/clearBlockKeyForDevice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,OAAO,CAAA;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAE9D,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,gBAAgB,QAgBtB"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
2
|
import { setBlockKeyForDevice } from './setBlockKeyForDevice';
|
|
3
3
|
import { clearBlockKeyForDevice } from './clearBlockKeyForDevice';
|
|
4
|
+
import { wrapInline } from './wrapInline';
|
|
5
|
+
import { unwrapInline } from './unwrapInline';
|
|
4
6
|
export declare const Block: {
|
|
5
7
|
setBlockKeyForDevice: typeof setBlockKeyForDevice;
|
|
6
8
|
clearBlockKeyForDevice: typeof clearBlockKeyForDevice;
|
|
9
|
+
wrapInline: typeof wrapInline;
|
|
10
|
+
unwrapInline: typeof unwrapInline;
|
|
7
11
|
};
|
|
8
12
|
export declare function withBlock(editor: Editor): import("slate").BaseEditor & import("slate-react").ReactEditor;
|
|
9
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/slate/BlockPlugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/slate/BlockPlugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG7C,eAAO,MAAM,KAAK;;;;;CAKjB,CAAA;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,kEAmBvC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
2
|
-
import { Device } from '../../controls/types';
|
|
3
|
-
import { Breakpoints } from '../../state/modules/breakpoints';
|
|
1
|
+
import { Editor, Location } from 'slate';
|
|
4
2
|
import { EditableBlockKey, EditableBlockValue } from './types';
|
|
5
|
-
|
|
3
|
+
import { Breakpoints, BreakpointId } from '../../state/modules/breakpoints';
|
|
4
|
+
declare type SetBlockKeyForDeviceOptions = {
|
|
5
|
+
at?: Location;
|
|
6
|
+
};
|
|
7
|
+
export declare function setBlockKeyForDevice(editor: Editor, breakpoints: Breakpoints, deviceId: BreakpointId, key: EditableBlockKey, value: EditableBlockValue[number]['value'], options?: SetBlockKeyForDeviceOptions): void;
|
|
8
|
+
export {};
|
|
6
9
|
//# sourceMappingURL=setBlockKeyForDevice.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setBlockKeyForDevice.d.ts","sourceRoot":"","sources":["../../../../../src/slate/BlockPlugin/setBlockKeyForDevice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"setBlockKeyForDevice.d.ts","sourceRoot":"","sources":["../../../../../src/slate/BlockPlugin/setBlockKeyForDevice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGpD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,YAAY,EAA0B,MAAM,iCAAiC,CAAA;AAEnG,aAAK,2BAA2B,GAAG;IACjC,EAAE,CAAC,EAAE,QAAQ,CAAA;CACd,CAAA;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAC1C,OAAO,CAAC,EAAE,2BAA2B,QAyBtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResponsiveBlockTextAlignment } from '../../controls';
|
|
2
2
|
export declare type EditableBlockKey = 'textAlign';
|
|
3
|
-
export declare type EditableBlockValue =
|
|
3
|
+
export declare type EditableBlockValue = ResponsiveBlockTextAlignment;
|
|
4
4
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/slate/BlockPlugin/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/slate/BlockPlugin/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAE7D,oBAAY,gBAAgB,GAAG,WAAW,CAAA;AAC1C,oBAAY,kBAAkB,GAAG,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unwrapInline.d.ts","sourceRoot":"","sources":["../../../../../src/slate/BlockPlugin/unwrapInline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,OAAO,CAAA;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,QAK5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapInline.d.ts","sourceRoot":"","sources":["../../../../../src/slate/BlockPlugin/wrapInline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,OAAO,CAAA;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEvC,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAKxD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
1
|
+
import { Editor, Location } from 'slate';
|
|
2
2
|
import { BlockType } from '../../controls';
|
|
3
3
|
declare type ToggleListOptions = {
|
|
4
4
|
type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList;
|
|
5
|
+
at?: Location;
|
|
5
6
|
};
|
|
6
7
|
export declare function toggleList(editor: Editor, options?: ToggleListOptions): void;
|
|
7
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleList.d.ts","sourceRoot":"","sources":["../../../../../src/slate/ListPlugin/toggleList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA0B,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"toggleList.d.ts","sourceRoot":"","sources":["../../../../../src/slate/ListPlugin/toggleList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAA0B,MAAM,OAAO,CAAA;AAKhE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,aAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,SAAS,CAAC,aAAa,GAAG,OAAO,SAAS,CAAC,WAAW,CAAA;IACnE,EAAE,CAAC,EAAE,QAAQ,CAAA;CACd,CAAA;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,iBAAqD,QAkB/D"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { Editor, Path } from 'slate';
|
|
1
|
+
import { Editor, Path, Location, Span } from 'slate';
|
|
2
2
|
export declare function unwrapPath(editor: Editor, listItemPath: Path): void;
|
|
3
|
-
|
|
3
|
+
declare type UnwrapListOptions = {
|
|
4
|
+
at?: Location | Span;
|
|
5
|
+
};
|
|
6
|
+
export declare function unwrapList(editor: Editor, options?: UnwrapListOptions): void;
|
|
7
|
+
export {};
|
|
4
8
|
//# sourceMappingURL=unwrapList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unwrapList.d.ts","sourceRoot":"","sources":["../../../../../src/slate/ListPlugin/unwrapList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"unwrapList.d.ts","sourceRoot":"","sources":["../../../../../src/slate/ListPlugin/unwrapList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAuB,IAAI,EAAQ,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAO/E,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,QA4B5D;AAED,aAAK,iBAAiB,GAAG;IACvB,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,QAqBrE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Element, NodeEntry } from 'slate';
|
|
2
2
|
import { Editor } from 'slate';
|
|
3
3
|
export declare function getSelectedListItems(editor: Editor): NodeEntry<Element>[];
|
|
4
|
-
export declare function getSelectedLists(editor: Editor): NodeEntry<Element>[];
|
|
5
4
|
//# sourceMappingURL=getSelectedListItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSelectedListItems.d.ts","sourceRoot":"","sources":["../../../../../../src/slate/ListPlugin/utils/getSelectedListItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAQ,MAAM,OAAO,CAAA;AAKpC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAezE
|
|
1
|
+
{"version":3,"file":"getSelectedListItems.d.ts","sourceRoot":"","sources":["../../../../../../src/slate/ListPlugin/utils/getSelectedListItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAQ,MAAM,OAAO,CAAA;AAKpC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAezE"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
1
|
+
import { Editor, Location, Span } from 'slate';
|
|
2
2
|
import { BlockType } from '../../controls';
|
|
3
3
|
declare type WrapListOptions = {
|
|
4
4
|
type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList;
|
|
5
|
+
at?: Location | Span;
|
|
5
6
|
};
|
|
6
7
|
export declare function wrapList(editor: Editor, options?: WrapListOptions): void;
|
|
7
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapList.d.ts","sourceRoot":"","sources":["../../../../../src/slate/ListPlugin/wrapList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"wrapList.d.ts","sourceRoot":"","sources":["../../../../../src/slate/ListPlugin/wrapList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,QAAQ,EAAE,IAAI,EAAc,MAAM,OAAO,CAAA;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,aAAK,eAAe,GAAG;IACrB,IAAI,EAAE,OAAO,SAAS,CAAC,aAAa,GAAG,OAAO,SAAS,CAAC,WAAW,CAAA;IACnE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,eAAmD,QAsC7D"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
2
|
-
|
|
1
|
+
import { Editor, Range } from 'slate';
|
|
2
|
+
declare type ClearActiveTypographyStyleOptions = {
|
|
3
|
+
at?: Range;
|
|
4
|
+
};
|
|
5
|
+
export declare function clearActiveTypographyStyle(editor: Editor, options?: ClearActiveTypographyStyleOptions): void;
|
|
6
|
+
export {};
|
|
3
7
|
//# sourceMappingURL=clearActiveTypographyStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearActiveTypographyStyle.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/clearActiveTypographyStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"clearActiveTypographyStyle.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/clearActiveTypographyStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,KAAK,EAAE,MAAM,OAAO,CAAA;AAGvD,aAAK,iCAAiC,GAAG;IACvC,EAAE,CAAC,EAAE,KAAK,CAAA;CACX,CAAA;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,iCAAiC,QAiD5C"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
2
|
-
|
|
1
|
+
import { Editor, Range } from 'slate';
|
|
2
|
+
declare type ClearDeviceActiveTypographyOptions = {
|
|
3
|
+
at?: Range;
|
|
4
|
+
};
|
|
5
|
+
export declare function clearDeviceActiveTypography(editor: Editor, currentDeviceId: string, options?: ClearDeviceActiveTypographyOptions): void;
|
|
6
|
+
export {};
|
|
3
7
|
//# sourceMappingURL=clearDeviceActiveTypography.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearDeviceActiveTypography.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/clearDeviceActiveTypography.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"clearDeviceActiveTypography.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/clearDeviceActiveTypography.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,KAAK,EAAE,MAAM,OAAO,CAAA;AAGvD,aAAK,kCAAkC,GAAG;IACxC,EAAE,CAAC,EAAE,KAAK,CAAA;CACX,CAAA;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EACvB,OAAO,CAAC,EAAE,kCAAkC,QAkD7C"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
1
|
+
import { Editor, Range } from 'slate';
|
|
2
2
|
import { RichTextTypography } from '../../controls';
|
|
3
|
-
|
|
3
|
+
declare type SetActiveTypographyIdOptions = {
|
|
4
|
+
at?: Range;
|
|
5
|
+
};
|
|
6
|
+
export declare function detachActiveTypography(editor: Editor, value: RichTextTypography['style'], options?: SetActiveTypographyIdOptions): void;
|
|
7
|
+
export {};
|
|
4
8
|
//# sourceMappingURL=detachActiveTypography.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detachActiveTypography.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/detachActiveTypography.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"detachActiveTypography.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/detachActiveTypography.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,KAAK,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAEnD,aAAK,4BAA4B,GAAG;IAClC,EAAE,CAAC,EAAE,KAAK,CAAA;CACX,CAAA;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,EAClC,OAAO,CAAC,EAAE,4BAA4B,QA8CvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAErE,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAA;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAErE,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAA;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,kEAsB5C"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
2
|
-
|
|
1
|
+
import { Editor, Range } from 'slate';
|
|
2
|
+
declare type SetActiveTypographyIdOptions = {
|
|
3
|
+
at?: Range;
|
|
4
|
+
};
|
|
5
|
+
export declare function setActiveTypographyId(editor: Editor, id?: string, options?: SetActiveTypographyIdOptions): void;
|
|
6
|
+
export {};
|
|
3
7
|
//# sourceMappingURL=setActiveTypographyId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setActiveTypographyId.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/setActiveTypographyId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"setActiveTypographyId.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/setActiveTypographyId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,KAAK,EAAE,MAAM,OAAO,CAAA;AAEvD,aAAK,4BAA4B,GAAG;IAClC,EAAE,CAAC,EAAE,KAAK,CAAA;CACX,CAAA;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,4BAA4B,QAkBvC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
1
|
+
import { Editor, Range } from 'slate';
|
|
2
2
|
import { Breakpoints } from '../../state/modules/breakpoints';
|
|
3
|
-
|
|
3
|
+
declare type SetActiveTypographyStyleOptions = {
|
|
4
|
+
at?: Range;
|
|
5
|
+
};
|
|
6
|
+
export declare function setActiveTypographyStyle(editor: Editor, breakpoints: Breakpoints, deviceId: string, prop: string, value?: unknown, options?: SetActiveTypographyStyleOptions): void;
|
|
7
|
+
export {};
|
|
4
8
|
//# sourceMappingURL=setActiveTypographyStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setActiveTypographyStyle.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/setActiveTypographyStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"setActiveTypographyStyle.d.ts","sourceRoot":"","sources":["../../../../../src/slate/TypographyPlugin/setActiveTypographyStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,KAAK,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAwC,MAAM,iCAAiC,CAAA;AAEnG,aAAK,+BAA+B,GAAG;IACrC,EAAE,CAAC,EAAE,KAAK,CAAA;CACX,CAAA;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,+BAA+B,QA+D1C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Editor, NodeEntry, Range } from 'slate';
|
|
2
|
+
import { EditableBlockKey } from './BlockPlugin/types';
|
|
3
|
+
import { RootBlock, Inline, RootBlockType, ResponsiveBlockTextAlignment, BlockTextAlignment, RichTextTypography } from '../controls';
|
|
4
|
+
import { Breakpoints, BreakpointId } from '../state/modules/breakpoints';
|
|
5
|
+
export declare function getSelection(editor: Editor): Range;
|
|
6
|
+
export declare function getBlocksInSelection(editor: Editor): NodeEntry<RootBlock>[];
|
|
7
|
+
export declare function getInlinesInSelection(editor: Editor): NodeEntry<Inline>[];
|
|
8
|
+
export declare function getActiveBlockType(editor: Editor): RootBlockType | null;
|
|
9
|
+
export declare function getActiveBlockValue(editor: Editor, key: EditableBlockKey): ResponsiveBlockTextAlignment | null;
|
|
10
|
+
export declare function getActiveBlockDeviceOverrideValue(editor: Editor, key: EditableBlockKey, breakpoints: Breakpoints, deviceId: BreakpointId): BlockTextAlignment | null;
|
|
11
|
+
/**
|
|
12
|
+
* This is a c/p of the intersection of the utils from the root utils folder.
|
|
13
|
+
* The only change is defaulting to undefined instead of to null.
|
|
14
|
+
*/
|
|
15
|
+
export default function intersection<A extends Record<string, unknown>, B extends A>(a: A, b: B, isEqual?: (a: unknown, b: unknown) => boolean): {
|
|
16
|
+
[K in keyof A]: A[K] | undefined;
|
|
17
|
+
};
|
|
18
|
+
export declare function getActiveTypographyMark(editor: Editor, breakpoints: Breakpoints): RichTextTypography;
|
|
19
|
+
//# sourceMappingURL=selectors.d.ts.map
|