@makeswift/runtime 0.8.9 → 0.8.10
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/Box.cjs.js +2 -4
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +2 -4
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +1 -4
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +1 -4
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +1 -4
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +1 -4
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +1 -4
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +1 -4
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +1 -4
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +1 -4
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +3 -5
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +3 -5
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +1 -4
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +2 -5
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs.js +1 -4
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +2 -5
- package/dist/Image.es.js.map +1 -1
- package/dist/LiveProvider.cjs.js +1 -4
- package/dist/LiveProvider.cjs.js.map +1 -1
- package/dist/LiveProvider.es.js +2 -5
- package/dist/LiveProvider.es.js.map +1 -1
- package/dist/Navigation.cjs.js +3 -5
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +3 -5
- package/dist/Navigation.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +1 -4
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +3 -6
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +62 -60
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +9 -7
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +318 -0
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -0
- package/dist/ReadOnlyTextV2.es.js +314 -0
- package/dist/ReadOnlyTextV2.es.js.map +1 -0
- package/dist/Root.cjs.js +2 -4
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +2 -4
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +1 -4
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +1 -4
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +2 -5
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +3 -6
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +1 -4
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +1 -4
- package/dist/Video.es.js.map +1 -1
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js.map +1 -1
- package/dist/builder.cjs.js +1 -2
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +1 -2
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +2 -4
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +2 -4
- package/dist/components.es.js.map +1 -1
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.es.js.map +1 -1
- package/dist/control-serialization.cjs.js +0 -2
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +0 -2
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +2 -6
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +2 -3
- package/dist/controls.es.js.map +1 -1
- package/dist/descriptors.cjs.js +53 -88
- package/dist/descriptors.cjs.js.map +1 -1
- package/dist/descriptors.es.js +32 -64
- package/dist/descriptors.es.js.map +1 -1
- package/dist/element.cjs.js +55 -0
- package/dist/element.cjs.js.map +1 -0
- package/dist/element.es.js +54 -0
- package/dist/element.es.js.map +1 -0
- package/dist/index.cjs.js +33 -116
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs2.js +3 -4
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs5.js +48 -82
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs6.js +41 -42
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs7.js +14 -341
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.cjs8.js +209 -0
- package/dist/index.cjs8.js.map +1 -0
- package/dist/index.cjs9.js +370 -0
- package/dist/index.cjs9.js.map +1 -0
- package/dist/index.es.js +32 -117
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +2 -3
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es3.js +1 -1
- package/dist/index.es5.js +19 -54
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +36 -40
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es7.js +13 -336
- package/dist/index.es7.js.map +1 -1
- package/dist/index.es8.js +202 -0
- package/dist/index.es8.js.map +1 -0
- package/dist/index.es9.js +363 -0
- package/dist/index.es9.js.map +1 -0
- package/dist/introspection.cjs.js +0 -2
- package/dist/introspection.cjs.js.map +1 -1
- package/dist/introspection.es.js +0 -2
- package/dist/introspection.es.js.map +1 -1
- package/dist/leaf.cjs.js.map +1 -1
- package/dist/leaf.es.js +1 -1
- package/dist/leaf.es.js.map +1 -1
- package/dist/main.cjs.js +1 -2
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +1 -2
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +1 -4
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +2 -5
- package/dist/next.es.js.map +1 -1
- package/dist/prop-controllers.cjs.js +1 -2
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +1 -2
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react.cjs.js +1 -4
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +1 -4
- package/dist/react.es.js.map +1 -1
- package/dist/slate.cjs.js +8 -3
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.cjs2.js +46 -0
- package/dist/slate.cjs2.js.map +1 -0
- package/dist/slate.es.js +6 -4
- package/dist/slate.es.js.map +1 -1
- package/dist/slate.es2.js +44 -0
- package/dist/slate.es2.js.map +1 -0
- package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +2 -1
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
- package/dist/types/src/controls/list.d.ts +2 -1
- package/dist/types/src/controls/list.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/dto-types.d.ts +1 -1
- package/dist/types/src/controls/rich-text/dto-types.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/index.d.ts +0 -1
- package/dist/types/src/controls/rich-text/index.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/rich-text.d.ts +1 -1
- package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/translation.d.ts +1 -1
- package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +25 -4
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +2 -1
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/controls/slot.d.ts +1 -1
- package/dist/types/src/controls/slot.d.ts.map +1 -1
- package/dist/types/src/controls/style.d.ts +2 -1
- package/dist/types/src/controls/style.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/base.d.ts +7 -0
- package/dist/types/src/prop-controllers/base.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/instances.d.ts +1 -5
- package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +13 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/index.d.ts +4 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/index.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useSyncDOMSelection.d.ts +9 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useSyncDOMSelection.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +21 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/index.d.ts +2 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/index.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +8 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/index.d.ts +1 -1
- package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/types.d.ts +1 -1
- package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts +1 -1
- package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts +1 -1
- package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts.map +1 -1
- package/dist/types/src/slate/BuilderPlugin/index.d.ts +7 -0
- package/dist/types/src/slate/BuilderPlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/InlineModePlugin/index.d.ts +5 -0
- package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/ListPlugin/index.d.ts +1 -1
- package/dist/types/src/slate/ListPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/ListPlugin/toggleList.d.ts +1 -1
- package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +1 -1
- package/dist/types/src/slate/ListPlugin/wrapList.d.ts +1 -1
- package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +1 -1
- package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/index.d.ts +1 -1
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
- package/dist/types/src/slate/index.d.ts +2 -0
- package/dist/types/src/slate/index.d.ts.map +1 -1
- package/dist/types/src/slate/selectors.d.ts +1 -1
- package/dist/types/src/slate/selectors.d.ts.map +1 -1
- package/dist/types/src/slate/utils/editor.d.ts +1 -1
- package/dist/types/src/slate/utils/editor.d.ts.map +1 -1
- package/dist/types/src/slate/utils/element.d.ts +1 -1
- package/dist/types/src/slate/utils/element.d.ts.map +1 -1
- package/dist/types/src/state/actions.d.ts +2 -1
- package/dist/types/src/state/actions.d.ts.map +1 -1
- package/dist/types/src/state/modules/prop-controller-handles.d.ts +2 -1
- package/dist/types/src/state/modules/prop-controller-handles.d.ts.map +1 -1
- package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/src/state/react-page.d.ts +1 -1
- package/dist/types/src/state/react-page.d.ts.map +1 -1
- package/dist/types/{src/controls/rich-text/types.d.ts → types/slate.d.ts} +20 -17
- package/dist/types/types/slate.d.ts.map +1 -0
- package/dist/useIsomorphicLayoutEffect.cjs.js +6 -0
- package/dist/useIsomorphicLayoutEffect.cjs.js.map +1 -0
- package/dist/useIsomorphicLayoutEffect.es.js +5 -0
- package/dist/useIsomorphicLayoutEffect.es.js.map +1 -0
- package/package.json +1 -1
- package/dist/types/src/controls/rich-text/types.d.ts.map +0 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2.d.ts +0 -15
- package/dist/types/src/runtimes/react/controls/rich-text-v2.d.ts.map +0 -1
package/dist/leaf.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leaf.cjs.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport { CSSObject } from '@emotion/serialize'\nimport { Swatch, Typography } from '../../../../../api'\nimport { DeviceOverride, ResponsiveValue } from '../../../../../prop-controllers'\nimport { useTypography, useSwatches } from '../../../../../runtimes/react/hooks/makeswift-api'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { colorToString } from '../../../../utils/colorToString'\nimport { isNonNullable } from '../../../../utils/isNonNullable'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { ColorValue } from '../../../../utils/types'\nimport { RichTextTypography } from '../../../../../controls'\nimport {\n findBreakpointOverride,\n shallowMergeFallbacks,\n} from '../../../../../state/modules/breakpoints'\nimport { useBreakpoints } from '../../../../../runtimes/react'\n\nexport type RichTextTypographyValue = RichTextTypography['style'][number]['value']\n\nfunction typographyFragementToRichTextTypography(\n typography: Typography | null,\n): RichTextTypography | undefined {\n if (typography == null) return undefined\n return {\n id: typography.id,\n style: typography.style.map(({ deviceId, value }) => ({\n deviceId,\n value: {\n fontFamily: value.fontFamily ?? undefined,\n lineHeight: value.lineHeight ?? undefined,\n letterSpacing: value.letterSpacing ?? undefined,\n fontWeight: value.fontWeight ?? undefined,\n textAlign: value.textAlign ?? undefined,\n uppercase: value.uppercase ?? undefined,\n underline: value.underline ?? undefined,\n strikethrough: value.strikethrough ?? undefined,\n italic: value.italic ?? undefined,\n fontSize: value.fontSize ?? undefined,\n color: value.color ?? undefined,\n },\n })),\n }\n}\n\ntype EnhancedColor = {\n color?: ColorValue\n}\n\ntype EnhancedTypographyValue = Omit<RichTextTypographyValue, keyof EnhancedColor> & EnhancedColor\n\nexport type EnhancedTypography = Array<DeviceOverride<EnhancedTypographyValue>>\n\nexport function getTypographyStyleSwatchIds(\n style: RichTextTypography['style'] | Typography['style'] | null | undefined,\n): string[] {\n return (\n style\n ?.map(override => override.value)\n .flatMap(typographyStyle => typographyStyle.color?.swatchId)\n .filter(isNonNullable) ?? []\n )\n}\n\nconst withColor =\n (swatches: Swatch[]) =>\n (\n deviceRawTypographyValue: DeviceOverride<RichTextTypographyValue>,\n ): DeviceOverride<EnhancedTypographyValue> => {\n const { value, deviceId } = deviceRawTypographyValue\n\n if (value.color == null) {\n const { color, ...nextValue } = value\n return {\n deviceId,\n value: nextValue,\n }\n }\n return {\n deviceId,\n value: {\n ...value,\n color: {\n swatch: swatches.find(s => s && s.id === value.color?.swatchId),\n alpha: value.color?.alpha ?? undefined,\n },\n },\n }\n }\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\n/**\n * `enhanced` here just means typography ids have been replaced with the related entity.\n */\nexport default function useEnhancedTypography(value?: RichTextTypography): EnhancedTypography {\n const typography = typographyFragementToRichTextTypography(useTypography(value?.id ?? null))\n const source = typography?.style ?? []\n const override = value?.style ?? []\n const breakpoints = useBreakpoints()\n\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds).filter(isNonNullable)\n\n const enhancedSource = source.map(withColor(swatches))\n const enhancedOverride = override.map(withColor(swatches))\n\n const devices = [\n ...new Set(enhancedSource.map(getDeviceId).concat(enhancedOverride.map(getDeviceId))),\n ]\n\n return devices\n .map(deviceId => {\n const deviceSource = findBreakpointOverride(breakpoints, enhancedSource, deviceId)?.value\n const deviceOverride = findBreakpointOverride(breakpoints, enhancedOverride, deviceId)?.value\n\n if (deviceSource && deviceOverride) {\n return {\n deviceId,\n value: { ...deviceSource, ...deviceOverride },\n }\n } else if (deviceOverride) {\n return {\n deviceId,\n value: deviceOverride,\n }\n } else if (deviceSource) {\n return {\n deviceId,\n value: deviceSource,\n }\n }\n return null\n })\n .filter(isNonNullable)\n}\n\nexport function useTypographyClassName(value: EnhancedTypography): string {\n return useStyle(\n useResponsiveStyle<\n EnhancedTypographyValue,\n [ResponsiveValue<EnhancedTypographyValue> | null | undefined]\n >(\n [value],\n ([value]) => {\n if (value === undefined) return {}\n\n let styles: CSSObject = {}\n if (value.color != null) styles.color = colorToString(value.color)\n if (value.fontFamily != null) styles.fontFamily = value.fontFamily\n if (value.fontSize != null && value.fontSize.value != null && value.fontSize.unit != null)\n styles.fontSize = `${value.fontSize.value}${value.fontSize.unit}`\n if (value.fontWeight != null) styles.fontWeight = value.fontWeight\n if (value.lineHeight != null) styles.lineHeight = value.lineHeight\n if (value.letterSpacing != null) styles.letterSpacing = `${value.letterSpacing / 10}em`\n if (value.uppercase != null)\n styles.textTransform = value.uppercase === true ? 'uppercase' : 'initial'\n if (value.underline != null || value.strikethrough != null)\n styles.textDecoration = [\n Boolean(value.underline) && 'underline',\n Boolean(value.strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' ')\n if (value.italic != null) styles.fontStyle = value.italic === true ? 'italic' : 'initial'\n\n return styles\n },\n shallowMergeFallbacks,\n ),\n )\n}\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n const enhancedTypography = useEnhancedTypography(leaf.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span {...props.attributes} className={typographyClassName}>\n {props.children}\n </span>\n )\n}\n"],"names":["typography","undefined","id","style","map","deviceId","value","fontFamily","lineHeight","letterSpacing","fontWeight","textAlign","uppercase","underline","strikethrough","italic","fontSize","color","override","flatMap","typographyStyle","swatchId","filter","isNonNullable","withColor","swatches","deviceRawTypographyValue","nextValue","swatch","find","s","alpha","getDeviceId","typographyFragementToRichTextTypography","useTypography","source","breakpoints","useBreakpoints","swatchIds","getTypographyStyleSwatchIds","useSwatches","enhancedSource","enhancedOverride","devices","Set","concat","deviceSource","findBreakpointOverride","deviceOverride","useStyle","useResponsiveStyle","styles","colorToString","unit","textTransform","textDecoration","Boolean","join","fontStyle","shallowMergeFallbacks","leaf","props","enhancedTypography","useEnhancedTypography","typographyClassName","useTypographyClassName","attributes","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,iDACEA,YACgC;AAChC,MAAIA,cAAc;AAAaC,WAAAA;AACxB,SAAA;AAAA,IACLC,IAAIF,WAAWE;AAAAA,IACfC,OAAOH,WAAWG,MAAMC,IAAI,CAAC;AAAA,MAAEC;AAAAA,MAAUC;AAAAA,UAAa;;AAAA;AAAA,QACpDD;AAAAA,QACAC,OAAO;AAAA,UACLC,YAAYD,YAAMC,eAAND,YAAoBL;AAAAA,UAChCO,YAAYF,YAAME,eAANF,YAAoBL;AAAAA,UAChCQ,eAAeH,YAAMG,kBAANH,YAAuBL;AAAAA,UACtCS,YAAYJ,YAAMI,eAANJ,YAAoBL;AAAAA,UAChCU,WAAWL,YAAMK,cAANL,YAAmBL;AAAAA,UAC9BW,WAAWN,YAAMM,cAANN,YAAmBL;AAAAA,UAC9BY,WAAW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,EAAAA,EAFX;AAKD;;;;"}
|
|
1
|
+
{"version":3,"file":"leaf.cjs.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport { CSSObject } from '@emotion/serialize'\nimport { Swatch, Typography } from '../../../../../api'\nimport { DeviceOverride, ResponsiveValue } from '../../../../../prop-controllers'\nimport { useTypography, useSwatches } from '../../../../../runtimes/react/hooks/makeswift-api'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { colorToString } from '../../../../utils/colorToString'\nimport { isNonNullable } from '../../../../utils/isNonNullable'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { ColorValue } from '../../../../utils/types'\nimport {\n findBreakpointOverride,\n shallowMergeFallbacks,\n} from '../../../../../state/modules/breakpoints'\nimport { useBreakpoints } from '../../../../../runtimes/react'\nimport { RichTextTypography } from '../../../../../../types/slate'\n\nexport type RichTextTypographyValue = RichTextTypography['style'][number]['value']\n\nfunction typographyFragementToRichTextTypography(\n typography: Typography | null,\n): RichTextTypography | undefined {\n if (typography == null) return undefined\n return {\n id: typography.id,\n style: typography.style.map(({ deviceId, value }) => ({\n deviceId,\n value: {\n fontFamily: value.fontFamily ?? undefined,\n lineHeight: value.lineHeight ?? undefined,\n letterSpacing: value.letterSpacing ?? undefined,\n fontWeight: value.fontWeight ?? undefined,\n textAlign: value.textAlign ?? undefined,\n uppercase: value.uppercase ?? undefined,\n underline: value.underline ?? undefined,\n strikethrough: value.strikethrough ?? undefined,\n italic: value.italic ?? undefined,\n fontSize: value.fontSize ?? undefined,\n color: value.color ?? undefined,\n },\n })),\n }\n}\n\ntype EnhancedColor = {\n color?: ColorValue\n}\n\ntype EnhancedTypographyValue = Omit<RichTextTypographyValue, keyof EnhancedColor> & EnhancedColor\n\nexport type EnhancedTypography = Array<DeviceOverride<EnhancedTypographyValue>>\n\nexport function getTypographyStyleSwatchIds(\n style: RichTextTypography['style'] | Typography['style'] | null | undefined,\n): string[] {\n return (\n style\n ?.map(override => override.value)\n .flatMap(typographyStyle => typographyStyle.color?.swatchId)\n .filter(isNonNullable) ?? []\n )\n}\n\nconst withColor =\n (swatches: Swatch[]) =>\n (\n deviceRawTypographyValue: DeviceOverride<RichTextTypographyValue>,\n ): DeviceOverride<EnhancedTypographyValue> => {\n const { value, deviceId } = deviceRawTypographyValue\n\n if (value.color == null) {\n const { color, ...nextValue } = value\n return {\n deviceId,\n value: nextValue,\n }\n }\n return {\n deviceId,\n value: {\n ...value,\n color: {\n swatch: swatches.find(s => s && s.id === value.color?.swatchId),\n alpha: value.color?.alpha ?? undefined,\n },\n },\n }\n }\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\n/**\n * `enhanced` here just means typography ids have been replaced with the related entity.\n */\nexport default function useEnhancedTypography(value?: RichTextTypography): EnhancedTypography {\n const typography = typographyFragementToRichTextTypography(useTypography(value?.id ?? null))\n const source = typography?.style ?? []\n const override = value?.style ?? []\n const breakpoints = useBreakpoints()\n\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds).filter(isNonNullable)\n\n const enhancedSource = source.map(withColor(swatches))\n const enhancedOverride = override.map(withColor(swatches))\n\n const devices = [\n ...new Set(enhancedSource.map(getDeviceId).concat(enhancedOverride.map(getDeviceId))),\n ]\n\n return devices\n .map(deviceId => {\n const deviceSource = findBreakpointOverride(breakpoints, enhancedSource, deviceId)?.value\n const deviceOverride = findBreakpointOverride(breakpoints, enhancedOverride, deviceId)?.value\n\n if (deviceSource && deviceOverride) {\n return {\n deviceId,\n value: { ...deviceSource, ...deviceOverride },\n }\n } else if (deviceOverride) {\n return {\n deviceId,\n value: deviceOverride,\n }\n } else if (deviceSource) {\n return {\n deviceId,\n value: deviceSource,\n }\n }\n return null\n })\n .filter(isNonNullable)\n}\n\nexport function useTypographyClassName(value: EnhancedTypography): string {\n return useStyle(\n useResponsiveStyle<\n EnhancedTypographyValue,\n [ResponsiveValue<EnhancedTypographyValue> | null | undefined]\n >(\n [value],\n ([value]) => {\n if (value === undefined) return {}\n\n let styles: CSSObject = {}\n if (value.color != null) styles.color = colorToString(value.color)\n if (value.fontFamily != null) styles.fontFamily = value.fontFamily\n if (value.fontSize != null && value.fontSize.value != null && value.fontSize.unit != null)\n styles.fontSize = `${value.fontSize.value}${value.fontSize.unit}`\n if (value.fontWeight != null) styles.fontWeight = value.fontWeight\n if (value.lineHeight != null) styles.lineHeight = value.lineHeight\n if (value.letterSpacing != null) styles.letterSpacing = `${value.letterSpacing / 10}em`\n if (value.uppercase != null)\n styles.textTransform = value.uppercase === true ? 'uppercase' : 'initial'\n if (value.underline != null || value.strikethrough != null)\n styles.textDecoration = [\n Boolean(value.underline) && 'underline',\n Boolean(value.strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' ')\n if (value.italic != null) styles.fontStyle = value.italic === true ? 'italic' : 'initial'\n\n return styles\n },\n shallowMergeFallbacks,\n ),\n )\n}\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n const enhancedTypography = useEnhancedTypography(leaf.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span {...props.attributes} className={typographyClassName}>\n {props.children}\n </span>\n )\n}\n"],"names":["typography","undefined","id","style","map","deviceId","value","fontFamily","lineHeight","letterSpacing","fontWeight","textAlign","uppercase","underline","strikethrough","italic","fontSize","color","override","flatMap","typographyStyle","swatchId","filter","isNonNullable","withColor","swatches","deviceRawTypographyValue","nextValue","swatch","find","s","alpha","getDeviceId","typographyFragementToRichTextTypography","useTypography","source","breakpoints","useBreakpoints","swatchIds","getTypographyStyleSwatchIds","useSwatches","enhancedSource","enhancedOverride","devices","Set","concat","deviceSource","findBreakpointOverride","deviceOverride","useStyle","useResponsiveStyle","styles","colorToString","unit","textTransform","textDecoration","Boolean","join","fontStyle","shallowMergeFallbacks","leaf","props","enhancedTypography","useEnhancedTypography","typographyClass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C,aAAOI,iBAAiB,CACtBC,QAAQlD,OAAMO,SAAP,KAAqB,aAC5B2C,QAAQlD,OAAMQ,aAAP,KAAyB,cAFV,EAIrBQ,OAAOkC,OAJc,EAKrBC,KAAK,GALgB;AAM1B,QAAInD,OAAMS,UAAU;AAAMoC,aAAOO,YAAYpD,OAAMS,WAAW,OAAO,WAAW;AAEzEoC,WAAAA;AAAAA,EAAAA,GAETQ,kBAAAA,qBA7BgB,CADL;AAiChB;AAEoB,cAAA,IAAqC;AAArC,eAAEC;AAAAA;AAAAA,MAAF,IAAWC,kBAAX,IAAWA;AAAAA,IAATD;AAAAA;AACfE,QAAAA,qBAAqBC,sBAAsBH,KAAK5D,UAAN;AAC1CgE,QAAAA,sBAAsBC,uBAAuBH,kBAAD;AAGhD,wCAAA,QAAA,iCAAUD,MAAMK,aAAhB;AAAA,IAA4B,WAAWF;AAAAA,IAAvC,UACGH,MAAMM;AAAAA,EAAAA,EAFX;AAKD;;;;"}
|
package/dist/leaf.es.js
CHANGED
|
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import {
|
|
32
|
+
import { U as useTypography, s as useBreakpoints, I as useSwatches, n as useStyle, o as useResponsiveStyle, r as colorToString } from "./index.es.js";
|
|
33
33
|
import { j as isNonNullable } from "./introspection.es.js";
|
|
34
34
|
import { findBreakpointOverride, shallowMergeFallbacks } from "./state/breakpoints.es.js";
|
|
35
35
|
import { jsx } from "react/jsx-runtime";
|
package/dist/leaf.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leaf.es.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport { CSSObject } from '@emotion/serialize'\nimport { Swatch, Typography } from '../../../../../api'\nimport { DeviceOverride, ResponsiveValue } from '../../../../../prop-controllers'\nimport { useTypography, useSwatches } from '../../../../../runtimes/react/hooks/makeswift-api'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { colorToString } from '../../../../utils/colorToString'\nimport { isNonNullable } from '../../../../utils/isNonNullable'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { ColorValue } from '../../../../utils/types'\nimport { RichTextTypography } from '../../../../../controls'\nimport {\n findBreakpointOverride,\n shallowMergeFallbacks,\n} from '../../../../../state/modules/breakpoints'\nimport { useBreakpoints } from '../../../../../runtimes/react'\n\nexport type RichTextTypographyValue = RichTextTypography['style'][number]['value']\n\nfunction typographyFragementToRichTextTypography(\n typography: Typography | null,\n): RichTextTypography | undefined {\n if (typography == null) return undefined\n return {\n id: typography.id,\n style: typography.style.map(({ deviceId, value }) => ({\n deviceId,\n value: {\n fontFamily: value.fontFamily ?? undefined,\n lineHeight: value.lineHeight ?? undefined,\n letterSpacing: value.letterSpacing ?? undefined,\n fontWeight: value.fontWeight ?? undefined,\n textAlign: value.textAlign ?? undefined,\n uppercase: value.uppercase ?? undefined,\n underline: value.underline ?? undefined,\n strikethrough: value.strikethrough ?? undefined,\n italic: value.italic ?? undefined,\n fontSize: value.fontSize ?? undefined,\n color: value.color ?? undefined,\n },\n })),\n }\n}\n\ntype EnhancedColor = {\n color?: ColorValue\n}\n\ntype EnhancedTypographyValue = Omit<RichTextTypographyValue, keyof EnhancedColor> & EnhancedColor\n\nexport type EnhancedTypography = Array<DeviceOverride<EnhancedTypographyValue>>\n\nexport function getTypographyStyleSwatchIds(\n style: RichTextTypography['style'] | Typography['style'] | null | undefined,\n): string[] {\n return (\n style\n ?.map(override => override.value)\n .flatMap(typographyStyle => typographyStyle.color?.swatchId)\n .filter(isNonNullable) ?? []\n )\n}\n\nconst withColor =\n (swatches: Swatch[]) =>\n (\n deviceRawTypographyValue: DeviceOverride<RichTextTypographyValue>,\n ): DeviceOverride<EnhancedTypographyValue> => {\n const { value, deviceId } = deviceRawTypographyValue\n\n if (value.color == null) {\n const { color, ...nextValue } = value\n return {\n deviceId,\n value: nextValue,\n }\n }\n return {\n deviceId,\n value: {\n ...value,\n color: {\n swatch: swatches.find(s => s && s.id === value.color?.swatchId),\n alpha: value.color?.alpha ?? undefined,\n },\n },\n }\n }\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\n/**\n * `enhanced` here just means typography ids have been replaced with the related entity.\n */\nexport default function useEnhancedTypography(value?: RichTextTypography): EnhancedTypography {\n const typography = typographyFragementToRichTextTypography(useTypography(value?.id ?? null))\n const source = typography?.style ?? []\n const override = value?.style ?? []\n const breakpoints = useBreakpoints()\n\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds).filter(isNonNullable)\n\n const enhancedSource = source.map(withColor(swatches))\n const enhancedOverride = override.map(withColor(swatches))\n\n const devices = [\n ...new Set(enhancedSource.map(getDeviceId).concat(enhancedOverride.map(getDeviceId))),\n ]\n\n return devices\n .map(deviceId => {\n const deviceSource = findBreakpointOverride(breakpoints, enhancedSource, deviceId)?.value\n const deviceOverride = findBreakpointOverride(breakpoints, enhancedOverride, deviceId)?.value\n\n if (deviceSource && deviceOverride) {\n return {\n deviceId,\n value: { ...deviceSource, ...deviceOverride },\n }\n } else if (deviceOverride) {\n return {\n deviceId,\n value: deviceOverride,\n }\n } else if (deviceSource) {\n return {\n deviceId,\n value: deviceSource,\n }\n }\n return null\n })\n .filter(isNonNullable)\n}\n\nexport function useTypographyClassName(value: EnhancedTypography): string {\n return useStyle(\n useResponsiveStyle<\n EnhancedTypographyValue,\n [ResponsiveValue<EnhancedTypographyValue> | null | undefined]\n >(\n [value],\n ([value]) => {\n if (value === undefined) return {}\n\n let styles: CSSObject = {}\n if (value.color != null) styles.color = colorToString(value.color)\n if (value.fontFamily != null) styles.fontFamily = value.fontFamily\n if (value.fontSize != null && value.fontSize.value != null && value.fontSize.unit != null)\n styles.fontSize = `${value.fontSize.value}${value.fontSize.unit}`\n if (value.fontWeight != null) styles.fontWeight = value.fontWeight\n if (value.lineHeight != null) styles.lineHeight = value.lineHeight\n if (value.letterSpacing != null) styles.letterSpacing = `${value.letterSpacing / 10}em`\n if (value.uppercase != null)\n styles.textTransform = value.uppercase === true ? 'uppercase' : 'initial'\n if (value.underline != null || value.strikethrough != null)\n styles.textDecoration = [\n Boolean(value.underline) && 'underline',\n Boolean(value.strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' ')\n if (value.italic != null) styles.fontStyle = value.italic === true ? 'italic' : 'initial'\n\n return styles\n },\n shallowMergeFallbacks,\n ),\n )\n}\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n const enhancedTypography = useEnhancedTypography(leaf.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span {...props.attributes} className={typographyClassName}>\n {props.children}\n </span>\n )\n}\n"],"names":["typography","undefined","id","style","map","deviceId","value","fontFamily","lineHeight","letterSpacing","fontWeight","textAlign","uppercase","underline","strikethrough","italic","fontSize","color","override","flatMap","typographyStyle","swatchId","filter","isNonNullable","withColor","swatches","deviceRawTypographyValue","nextValue","swatch","find","s","alpha","getDeviceId","typographyFragementToRichTextTypography","useTypography","source","breakpoints","useBreakpoints","swatchIds","getTypographyStyleSwatchIds","useSwatches","enhancedSource","enhancedOverride","devices","Set","concat","deviceSource","findBreakpointOverride","deviceOverride","useStyle","useResponsiveStyle","styles","colorToString","unit","textTransform","textDecoration","Boolean","join","fontStyle","shallowMergeFallbacks","leaf","props","enhancedTypography","useEnhancedTypography","typographyClassName","useTypographyClassName","attributes","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,iDACEA,YACgC;AAChC,MAAIA,cAAc;AAAaC,WAAAA;AACxB,SAAA;AAAA,IACLC,IAAIF,WAAWE;AAAAA,IACfC,OAAOH,WAAWG,MAAMC,IAAI,CAAC;AAAA,MAAEC;AAAAA,MAAUC;AAAAA,UAAa;;AAAA;AAAA,Q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AX,IAAWA;AAAAA,IAATD;AAAAA;AACfE,QAAAA,qBAAqBC,sBAAsBH,KAAK5D,UAAN;AAC1CgE,QAAAA,sBAAsBC,uBAAuBH,kBAAD;AAGhD,6BAAA,QAAA,iCAAUD,MAAMK,aAAhB;AAAA,IAA4B,WAAWF;AAAAA,IAAvC,UACGH,MAAMM;AAAAA,EAAAA,EAFX;AAKD;;"}
|
|
1
|
+
{"version":3,"file":"leaf.es.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport { CSSObject } from '@emotion/serialize'\nimport { Swatch, Typography } from '../../../../../api'\nimport { DeviceOverride, ResponsiveValue } from '../../../../../prop-controllers'\nimport { useTypography, useSwatches } from '../../../../../runtimes/react/hooks/makeswift-api'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { colorToString } from '../../../../utils/colorToString'\nimport { isNonNullable } from '../../../../utils/isNonNullable'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { ColorValue } from '../../../../utils/types'\nimport {\n findBreakpointOverride,\n shallowMergeFallbacks,\n} from '../../../../../state/modules/breakpoints'\nimport { useBreakpoints } from '../../../../../runtimes/react'\nimport { RichTextTypography } from '../../../../../../types/slate'\n\nexport type RichTextTypographyValue = RichTextTypography['style'][number]['value']\n\nfunction typographyFragementToRichTextTypography(\n typography: Typography | null,\n): RichTextTypography | undefined {\n if (typography == null) return undefined\n return {\n id: typography.id,\n style: typography.style.map(({ deviceId, value }) => ({\n deviceId,\n value: {\n fontFamily: value.fontFamily ?? undefined,\n lineHeight: value.lineHeight ?? undefined,\n letterSpacing: value.letterSpacing ?? undefined,\n fontWeight: value.fontWeight ?? undefined,\n textAlign: value.textAlign ?? undefined,\n uppercase: value.uppercase ?? undefined,\n underline: value.underline ?? undefined,\n strikethrough: value.strikethrough ?? undefined,\n italic: value.italic ?? undefined,\n fontSize: value.fontSize ?? undefined,\n color: value.color ?? undefined,\n },\n })),\n }\n}\n\ntype EnhancedColor = {\n color?: ColorValue\n}\n\ntype EnhancedTypographyValue = Omit<RichTextTypographyValue, keyof EnhancedColor> & EnhancedColor\n\nexport type EnhancedTypography = Array<DeviceOverride<EnhancedTypographyValue>>\n\nexport function getTypographyStyleSwatchIds(\n style: RichTextTypography['style'] | Typography['style'] | null | undefined,\n): string[] {\n return (\n style\n ?.map(override => override.value)\n .flatMap(typographyStyle => typographyStyle.color?.swatchId)\n .filter(isNonNullable) ?? []\n )\n}\n\nconst withColor =\n (swatches: Swatch[]) =>\n (\n deviceRawTypographyValue: DeviceOverride<RichTextTypographyValue>,\n ): DeviceOverride<EnhancedTypographyValue> => {\n const { value, deviceId } = deviceRawTypographyValue\n\n if (value.color == null) {\n const { color, ...nextValue } = value\n return {\n deviceId,\n value: nextValue,\n }\n }\n return {\n deviceId,\n value: {\n ...value,\n color: {\n swatch: swatches.find(s => s && s.id === value.color?.swatchId),\n alpha: value.color?.alpha ?? undefined,\n },\n },\n }\n }\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\n/**\n * `enhanced` here just means typography ids have been replaced with the related entity.\n */\nexport default function useEnhancedTypography(value?: RichTextTypography): EnhancedTypography {\n const typography = typographyFragementToRichTextTypography(useTypography(value?.id ?? null))\n const source = typography?.style ?? []\n const override = value?.style ?? []\n const breakpoints = useBreakpoints()\n\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds).filter(isNonNullable)\n\n const enhancedSource = source.map(withColor(swatches))\n const enhancedOverride = override.map(withColor(swatches))\n\n const devices = [\n ...new Set(enhancedSource.map(getDeviceId).concat(enhancedOverride.map(getDeviceId))),\n ]\n\n return devices\n .map(deviceId => {\n const deviceSource = findBreakpointOverride(breakpoints, enhancedSource, deviceId)?.value\n const deviceOverride = findBreakpointOverride(breakpoints, enhancedOverride, deviceId)?.value\n\n if (deviceSource && deviceOverride) {\n return {\n deviceId,\n value: { ...deviceSource, ...deviceOverride },\n }\n } else if (deviceOverride) {\n return {\n deviceId,\n value: deviceOverride,\n }\n } else if (deviceSource) {\n return {\n deviceId,\n value: deviceSource,\n }\n }\n return null\n })\n .filter(isNonNullable)\n}\n\nexport function useTypographyClassName(value: EnhancedTypography): string {\n return useStyle(\n useResponsiveStyle<\n EnhancedTypographyValue,\n [ResponsiveValue<EnhancedTypographyValue> | null | undefined]\n >(\n [value],\n ([value]) => {\n if (value === undefined) return {}\n\n let styles: CSSObject = {}\n if (value.color != null) styles.color = colorToString(value.color)\n if (value.fontFamily != null) styles.fontFamily = value.fontFamily\n if (value.fontSize != null && value.fontSize.value != null && value.fontSize.unit != null)\n styles.fontSize = `${value.fontSize.value}${value.fontSize.unit}`\n if (value.fontWeight != null) styles.fontWeight = value.fontWeight\n if (value.lineHeight != null) styles.lineHeight = value.lineHeight\n if (value.letterSpacing != null) styles.letterSpacing = `${value.letterSpacing / 10}em`\n if (value.uppercase != null)\n styles.textTransform = value.uppercase === true ? 'uppercase' : 'initial'\n if (value.underline != null || value.strikethrough != null)\n styles.textDecoration = [\n Boolean(value.underline) && 'underline',\n Boolean(value.strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' ')\n if (value.italic != null) styles.fontStyle = value.italic === true ? 'italic' : 'initial'\n\n return styles\n },\n shallowMergeFallbacks,\n ),\n )\n}\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n const enhancedTypography = useEnhancedTypography(leaf.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span {...props.attributes} className={typographyClassName}>\n {props.children}\n </span>\n )\n}\n"],"names":["typography","undefined","id","style","map","deviceId","value","fontFamily","lineHeight","letterSpacing","fontWeight","textAlign","uppercase","underline","strikethrough","italic","fontSize","color","override","flatMap","typographyStyle","swatchId","filter","isNonNullable","withColor","swatches","deviceRawTypographyValue","nextValue","swatch","find","s","alpha","getDeviceId","typographyFragementToRichTextTypography","useTypography","source","breakpoints","useBreakpoints","swatchIds","getTypographyStyleSwatchIds","useSwatches","enhancedSource","enhancedOverride","devices","Set","concat","deviceSource","findBreakpointOverride","deviceOverride","useStyle","useResponsiveStyle","styles","colorToString","unit","textTransform","textDecoration","Boolean","join","fontStyle","shallowMergeFallbacks","leaf","props","enhancedTypography","useEnhancedTypography","typographyClassName","useTypographyClassName","attributes","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,iDACEA,YACgC;AAChC,MAAIA,cAAc;AAAaC,WAAAA;AACxB,SAAA;AAAA,IACLC,IAAIF,WAAWE;AAAAA,IACfC,OAAOH,WAAWG,MAAMC,IAAI,CAAC;AAAA,MAAEC;AAAAA,MAAUC;AAAAA,UAAa;;AAAA;AAAA,QACpDD;AAAAA,QACAC,OAAO;AAAA,UACLC,YAAYD,YAAMC,eAAND,YAAoBL;AAAAA,UAChCO,YAAYF,YAAME,eAANF,YAAoBL;AAAAA,UAChCQ,eAAeH,YAAMG,kBAANH,YAAuBL;AAAAA,UACtCS,YAAYJ,YAAMI,eAANJ,YAAoBL;AAAAA,UAChCU,WAAWL,YAAMK,cAANL,YAAmBL;AAAAA,UAC9BW,WAAWN,YAAMM,cAANN,YAAmBL;AAAAA,UAC9BY,WAAWP,YAAMO,cAANP,YAAmBL;AAAAA,UAC9Ba,eAAeR,YAAMQ,kBAANR,YAAuBL;AAAAA,UACtCc,QAAQT,YAAMS,WAANT,YAAgBL;AAAAA,UACxBe,UAAUV,YAAMU,aAANV,YAAkBL;AAAAA,UAC5BgB,OAAOX,YAAMW,UAANX,YAAeL;AAAAA,QAXjB;AAAA,MAAA;AAAA,KAFF;AAAA,EAAA;AAiBV;AAUM,qCACLE,OACU;;AAERA,SAAAA,qCACIC,IAAIc,CAAYA,aAAAA,SAASZ,OAC1Ba,QAAQC,CAAmBA,oBAAAA;;AAAAA,kCAAgBH,UAAhBG,oBAAuBC;AAAAA,KAClDC,OAAOC,mBAHVpB,YAG4B;AAE/B;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jF,QAAIH,OAAMM,aAAa;AACrBuC,aAAOG,gBAAgBhD,OAAMM,cAAc,OAAO,cAAc;AAClE,QAAIN,OAAMO,aAAa,QAAQP,OAAMQ,iBAAiB;AACpDqC,aAAOI,iBAAiB,CACtBC,QAAQlD,OAAMO,SAAP,KAAqB,aAC5B2C,QAAQlD,OAAMQ,aAAP,KAAyB,cAFV,EAIrBQ,OAAOkC,OAJc,EAKrBC,KAAK,GALgB;AAM1B,QAAInD,OAAMS,UAAU;AAAMoC,aAAOO,YAAYpD,OAAMS,WAAW,OAAO,WAAW;AAEzEoC,WAAAA;AAAAA,EAAAA,GAETQ,qBA7BgB,CADL;AAiChB;AAEoB,cAAA,IAAqC;AAArC,eAAEC;AAAAA;AAAAA,MAAF,IAAWC,kBAAX,IAAWA;AAAAA,IAATD;AAAAA;AACfE,QAAAA,qBAAqBC,sBAAsBH,KAAK5D,UAAN;AAC1CgE,QAAAA,sBAAsBC,uBAAuBH,kBAAD;AAGhD,6BAAA,QAAA,iCAAUD,MAAMK,aAAhB;AAAA,IAA4B,WAAWF;AAAAA,IAAvC,UACGH,MAAMM;AAAAA,EAAAA,EAFX;AAKD;;"}
|
package/dist/main.cjs.js
CHANGED
|
@@ -5,8 +5,7 @@ var constants = require("./constants.cjs.js");
|
|
|
5
5
|
require("redux");
|
|
6
6
|
require("redux-thunk");
|
|
7
7
|
require("./descriptors.cjs.js");
|
|
8
|
-
require("slate");
|
|
9
|
-
require("slate-react");
|
|
8
|
+
require("./slate.cjs2.js");
|
|
10
9
|
require("./state/breakpoints.cjs.js");
|
|
11
10
|
require("./introspection.cjs.js");
|
|
12
11
|
exports.ActionTypes = actions.ActionTypes;
|
package/dist/main.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/main.es.js
CHANGED
|
@@ -3,8 +3,7 @@ export { M as MakeswiftComponentType, c as createDocument } from "./constants.es
|
|
|
3
3
|
import "redux";
|
|
4
4
|
import "redux-thunk";
|
|
5
5
|
import "./descriptors.es.js";
|
|
6
|
-
import "slate";
|
|
7
|
-
import "slate-react";
|
|
6
|
+
import "./slate.es2.js";
|
|
8
7
|
import "./state/breakpoints.es.js";
|
|
9
8
|
import "./introspection.es.js";
|
|
10
9
|
//# sourceMappingURL=main.es.js.map
|
package/dist/main.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/next.cjs.js
CHANGED
|
@@ -10,8 +10,7 @@ require("redux");
|
|
|
10
10
|
require("redux-thunk");
|
|
11
11
|
require("./actions.cjs.js");
|
|
12
12
|
require("./descriptors.cjs.js");
|
|
13
|
-
require("slate");
|
|
14
|
-
require("slate-react");
|
|
13
|
+
require("./slate.cjs2.js");
|
|
15
14
|
require("./state/breakpoints.cjs.js");
|
|
16
15
|
require("./introspection.cjs.js");
|
|
17
16
|
require("@emotion/css");
|
|
@@ -25,8 +24,6 @@ require("./box-models.cjs.js");
|
|
|
25
24
|
require("css-box-model");
|
|
26
25
|
require("color");
|
|
27
26
|
require("scroll-into-view-if-needed");
|
|
28
|
-
require("is-hotkey");
|
|
29
|
-
require("slate-history");
|
|
30
27
|
require("react-dom");
|
|
31
28
|
require("html-react-parser");
|
|
32
29
|
require("next/head");
|
package/dist/next.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"next.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/next.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
export {
|
|
2
|
+
export { $ as Document, Z as Makeswift, a0 as MakeswiftApiHandler, Y as Page, _ as PreviewModeScript, F as forwardNextDynamicRef, X as getServerSideProps, V as getStaticPaths, W as getStaticProps } from "./index.es.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "use-sync-external-store/shim/with-selector";
|
|
5
5
|
import "next/dynamic";
|
|
@@ -8,8 +8,7 @@ import "redux";
|
|
|
8
8
|
import "redux-thunk";
|
|
9
9
|
import "./actions.es.js";
|
|
10
10
|
import "./descriptors.es.js";
|
|
11
|
-
import "slate";
|
|
12
|
-
import "slate-react";
|
|
11
|
+
import "./slate.es2.js";
|
|
13
12
|
import "./state/breakpoints.es.js";
|
|
14
13
|
import "./introspection.es.js";
|
|
15
14
|
import "@emotion/css";
|
|
@@ -23,8 +22,6 @@ import "./box-models.es.js";
|
|
|
23
22
|
import "css-box-model";
|
|
24
23
|
import "color";
|
|
25
24
|
import "scroll-into-view-if-needed";
|
|
26
|
-
import "is-hotkey";
|
|
27
|
-
import "slate-history";
|
|
28
25
|
import "react-dom";
|
|
29
26
|
import "html-react-parser";
|
|
30
27
|
import "next/head";
|
package/dist/next.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"next.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
var descriptors = require("./descriptors.cjs.js");
|
|
4
4
|
var introspection = require("./introspection.cjs.js");
|
|
5
|
-
require("slate");
|
|
6
|
-
require("slate-react");
|
|
7
5
|
require("./actions.cjs.js");
|
|
6
|
+
require("./slate.cjs2.js");
|
|
8
7
|
exports.Props = descriptors.descriptors;
|
|
9
8
|
exports.RichTextPropControllerMessageType = descriptors.RichTextPropControllerMessageType;
|
|
10
9
|
exports.TableFormFieldsMessageType = descriptors.TableFormFieldsMessageType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-controllers.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prop-controllers.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { d as Props, R as RichTextPropControllerMessageType, e as TableFormFieldsMessageType } from "./descriptors.es.js";
|
|
2
2
|
export { i as Introspection } from "./introspection.es.js";
|
|
3
|
-
import "slate";
|
|
4
|
-
import "slate-react";
|
|
5
3
|
import "./actions.es.js";
|
|
4
|
+
import "./slate.es2.js";
|
|
6
5
|
//# sourceMappingURL=prop-controllers.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-controllers.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prop-controllers.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/react.cjs.js
CHANGED
|
@@ -9,8 +9,7 @@ require("./constants.cjs.js");
|
|
|
9
9
|
require("redux");
|
|
10
10
|
require("redux-thunk");
|
|
11
11
|
require("./descriptors.cjs.js");
|
|
12
|
-
require("slate");
|
|
13
|
-
require("slate-react");
|
|
12
|
+
require("./slate.cjs2.js");
|
|
14
13
|
require("./state/breakpoints.cjs.js");
|
|
15
14
|
require("./introspection.cjs.js");
|
|
16
15
|
require("@emotion/css");
|
|
@@ -25,8 +24,6 @@ require("./box-models.cjs.js");
|
|
|
25
24
|
require("css-box-model");
|
|
26
25
|
require("color");
|
|
27
26
|
require("scroll-into-view-if-needed");
|
|
28
|
-
require("is-hotkey");
|
|
29
|
-
require("slate-history");
|
|
30
27
|
require("react-dom");
|
|
31
28
|
require("html-react-parser");
|
|
32
29
|
require("next/head");
|
package/dist/react.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/react.es.js
CHANGED
|
@@ -7,8 +7,7 @@ import "./constants.es.js";
|
|
|
7
7
|
import "redux";
|
|
8
8
|
import "redux-thunk";
|
|
9
9
|
import "./descriptors.es.js";
|
|
10
|
-
import "slate";
|
|
11
|
-
import "slate-react";
|
|
10
|
+
import "./slate.es2.js";
|
|
12
11
|
import "./state/breakpoints.es.js";
|
|
13
12
|
import "./introspection.es.js";
|
|
14
13
|
import "@emotion/css";
|
|
@@ -23,8 +22,6 @@ import "./box-models.es.js";
|
|
|
23
22
|
import "css-box-model";
|
|
24
23
|
import "color";
|
|
25
24
|
import "scroll-into-view-if-needed";
|
|
26
|
-
import "is-hotkey";
|
|
27
|
-
import "slate-history";
|
|
28
25
|
import "react-dom";
|
|
29
26
|
import "html-react-parser";
|
|
30
27
|
import "next/head";
|
package/dist/react.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/slate.cjs.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
var index = require("./index.cjs5.js");
|
|
4
|
+
var index$1 = require("./index.cjs6.js");
|
|
4
5
|
require("slate");
|
|
5
6
|
require("is-hotkey");
|
|
6
|
-
require("./
|
|
7
|
-
require("slate
|
|
8
|
-
require("./actions.cjs.js");
|
|
7
|
+
require("./element.cjs.js");
|
|
8
|
+
require("./slate.cjs2.js");
|
|
9
9
|
require("./state/breakpoints.cjs.js");
|
|
10
|
+
require("./actions.cjs.js");
|
|
11
|
+
require("slate-react");
|
|
10
12
|
exports.Block = index.Block;
|
|
11
13
|
exports.List = index.List;
|
|
12
14
|
exports.Typography = index.Typography;
|
|
13
15
|
exports.onKeyDown = index.onKeyDown;
|
|
14
16
|
exports.withBlock = index.withBlock;
|
|
17
|
+
exports.withBuilder = index.withBuilder;
|
|
15
18
|
exports.withList = index.withList;
|
|
16
19
|
exports.withTypography = index.withTypography;
|
|
20
|
+
exports.InlineMode = index$1.InlineMode;
|
|
21
|
+
exports.withInlineMode = index$1.withInlineMode;
|
|
17
22
|
//# sourceMappingURL=slate.cjs.js.map
|
package/dist/slate.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slate.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slate.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
const RootBlockType = {
|
|
22
|
+
Text: "text-block",
|
|
23
|
+
Paragraph: "paragraph",
|
|
24
|
+
Heading1: "heading-one",
|
|
25
|
+
Heading2: "heading-two",
|
|
26
|
+
Heading3: "heading-three",
|
|
27
|
+
Heading4: "heading-four",
|
|
28
|
+
Heading5: "heading-five",
|
|
29
|
+
Heading6: "heading-six",
|
|
30
|
+
BlockQuote: "blockquote",
|
|
31
|
+
UnorderedList: "unordered-list",
|
|
32
|
+
OrderedList: "ordered-list"
|
|
33
|
+
};
|
|
34
|
+
const BlockType = __spreadProps(__spreadValues({}, RootBlockType), {
|
|
35
|
+
ListItem: "list-item",
|
|
36
|
+
ListItemChild: "list-item-child"
|
|
37
|
+
});
|
|
38
|
+
const InlineType = {
|
|
39
|
+
Code: "code",
|
|
40
|
+
SuperScript: "superscript",
|
|
41
|
+
SubScript: "subscript",
|
|
42
|
+
Link: "link"
|
|
43
|
+
};
|
|
44
|
+
exports.BlockType = BlockType;
|
|
45
|
+
exports.InlineType = InlineType;
|
|
46
|
+
//# sourceMappingURL=slate.cjs2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slate.cjs2.js","sources":["../types/slate.ts"],"sourcesContent":["import { BaseEditor, Descendant } from 'slate'\nimport { ReactEditor } from 'slate-react'\nimport { LinkControlData } from '../src/controls'\nimport { HistoryEditor } from 'slate-history'\nimport { BuilderEditor } from '../src/slate'\nimport { ResponsiveValue } from '../src/prop-controllers'\n\nexport type RichTextTypography = {\n id?: string\n style: Array<{\n deviceId: string\n value: {\n fontFamily?: string | null\n lineHeight?: number | null\n letterSpacing?: number | null\n fontWeight?: number | null\n textAlign?: string | null\n uppercase?: boolean | null\n underline?: boolean | null\n strikethrough?: boolean | null\n italic?: boolean | null\n fontSize?: { value: number | null; unit: string | null } | null\n color?: { swatchId: string | null; alpha: number | null } | null\n }\n }>\n}\n\nexport type Text = {\n text: string\n typography?: RichTextTypography\n slice?: boolean\n}\n\nexport const RootBlockType = {\n Text: 'text-block',\n Paragraph: 'paragraph',\n Heading1: 'heading-one',\n Heading2: 'heading-two',\n Heading3: 'heading-three',\n Heading4: 'heading-four',\n Heading5: 'heading-five',\n Heading6: 'heading-six',\n BlockQuote: 'blockquote',\n UnorderedList: 'unordered-list',\n OrderedList: 'ordered-list',\n} as const\n\nexport type RootBlockType = typeof RootBlockType[keyof typeof RootBlockType]\n\nexport const BlockType = {\n ...RootBlockType,\n ListItem: 'list-item',\n ListItemChild: 'list-item-child',\n} as const\n\nexport type BlockType = typeof BlockType[keyof typeof BlockType]\n\nexport type TextElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Text\n}\n\nexport type ParagraphElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Paragraph\n}\n\nexport type Heading1Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading1\n}\n\nexport type Heading2Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading2\n}\n\nexport type Heading3Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading3\n}\n\nexport type Heading4Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading4\n}\n\nexport type Heading5Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading5\n}\n\nexport type Heading6Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading6\n}\n\nexport type BlockQuoteElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.BlockQuote\n}\n\nexport type UnorderedListElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.UnorderedList\n}\n\nexport type OrderedListElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.OrderedList\n}\n\nexport type ListElement = OrderedListElement | UnorderedListElement\n\nexport type ListItemElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.ListItem\n}\n\nexport type ListItemChildElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.ListItemChild\n}\n\nexport const InlineType = {\n Code: 'code',\n SuperScript: 'superscript',\n SubScript: 'subscript',\n Link: 'link',\n} as const\n\nexport type InlineType = typeof InlineType[keyof typeof InlineType]\n\nexport const BlockTextAlignment = {\n Left: 'left',\n Center: 'center',\n Right: 'right',\n Justify: 'justify',\n} as const\n\nexport type BlockTextAlignment = typeof BlockTextAlignment[keyof typeof BlockTextAlignment]\n\nexport type ResponsiveBlockTextAlignment = ResponsiveValue<BlockTextAlignment>\n\nexport type CodeElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.Code\n}\n\nexport type SuperElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.SuperScript\n}\n\nexport type SubElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.SubScript\n}\n\nexport type LinkElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.Link\n link: LinkControlData\n}\n\nexport type RootBlock =\n | TextElement\n | ParagraphElement\n | Heading1Element\n | Heading2Element\n | Heading3Element\n | Heading4Element\n | Heading5Element\n | Heading6Element\n | BlockQuoteElement\n | ListElement\n\nexport type Block = RootBlock | ListItemElement | ListItemChildElement\n\nexport type Inline = CodeElement | SuperElement | SubElement | LinkElement\n\nexport type Element = Block | Inline\n\nexport type RichTextDAO = Descendant[]\n\nexport type MakeswiftEditor = BaseEditor & ReactEditor & HistoryEditor & BuilderEditor\n\ndeclare module 'slate' {\n interface CustomTypes {\n Editor: MakeswiftEditor\n Element: Element\n Text: Text\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAiCO,MAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AACf;AAIO,MAAM,YAAY,iCACpB,gBADoB;AAAA,EAEvB,UAAU;AAAA,EACV,eAAe;AACjB;AAoFO,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,WAAW;AAAA,EACX,MAAM;AACR;;;"}
|
package/dist/slate.es.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export { B as Block, L as List, T as Typography, o as onKeyDown, b as withBlock, w as withList, a as withTypography } from "./index.es5.js";
|
|
1
|
+
export { B as Block, L as List, T as Typography, o as onKeyDown, b as withBlock, c as withBuilder, w as withList, a as withTypography } from "./index.es5.js";
|
|
2
|
+
export { I as InlineMode, w as withInlineMode } from "./index.es6.js";
|
|
2
3
|
import "slate";
|
|
3
4
|
import "is-hotkey";
|
|
4
|
-
import "./
|
|
5
|
-
import "slate
|
|
6
|
-
import "./actions.es.js";
|
|
5
|
+
import "./element.es.js";
|
|
6
|
+
import "./slate.es2.js";
|
|
7
7
|
import "./state/breakpoints.es.js";
|
|
8
|
+
import "./actions.es.js";
|
|
9
|
+
import "slate-react";
|
|
8
10
|
//# sourceMappingURL=slate.es.js.map
|
package/dist/slate.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slate.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slate.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
const RootBlockType = {
|
|
21
|
+
Text: "text-block",
|
|
22
|
+
Paragraph: "paragraph",
|
|
23
|
+
Heading1: "heading-one",
|
|
24
|
+
Heading2: "heading-two",
|
|
25
|
+
Heading3: "heading-three",
|
|
26
|
+
Heading4: "heading-four",
|
|
27
|
+
Heading5: "heading-five",
|
|
28
|
+
Heading6: "heading-six",
|
|
29
|
+
BlockQuote: "blockquote",
|
|
30
|
+
UnorderedList: "unordered-list",
|
|
31
|
+
OrderedList: "ordered-list"
|
|
32
|
+
};
|
|
33
|
+
const BlockType = __spreadProps(__spreadValues({}, RootBlockType), {
|
|
34
|
+
ListItem: "list-item",
|
|
35
|
+
ListItemChild: "list-item-child"
|
|
36
|
+
});
|
|
37
|
+
const InlineType = {
|
|
38
|
+
Code: "code",
|
|
39
|
+
SuperScript: "superscript",
|
|
40
|
+
SubScript: "subscript",
|
|
41
|
+
Link: "link"
|
|
42
|
+
};
|
|
43
|
+
export { BlockType as B, InlineType as I };
|
|
44
|
+
//# sourceMappingURL=slate.es2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slate.es2.js","sources":["../types/slate.ts"],"sourcesContent":["import { BaseEditor, Descendant } from 'slate'\nimport { ReactEditor } from 'slate-react'\nimport { LinkControlData } from '../src/controls'\nimport { HistoryEditor } from 'slate-history'\nimport { BuilderEditor } from '../src/slate'\nimport { ResponsiveValue } from '../src/prop-controllers'\n\nexport type RichTextTypography = {\n id?: string\n style: Array<{\n deviceId: string\n value: {\n fontFamily?: string | null\n lineHeight?: number | null\n letterSpacing?: number | null\n fontWeight?: number | null\n textAlign?: string | null\n uppercase?: boolean | null\n underline?: boolean | null\n strikethrough?: boolean | null\n italic?: boolean | null\n fontSize?: { value: number | null; unit: string | null } | null\n color?: { swatchId: string | null; alpha: number | null } | null\n }\n }>\n}\n\nexport type Text = {\n text: string\n typography?: RichTextTypography\n slice?: boolean\n}\n\nexport const RootBlockType = {\n Text: 'text-block',\n Paragraph: 'paragraph',\n Heading1: 'heading-one',\n Heading2: 'heading-two',\n Heading3: 'heading-three',\n Heading4: 'heading-four',\n Heading5: 'heading-five',\n Heading6: 'heading-six',\n BlockQuote: 'blockquote',\n UnorderedList: 'unordered-list',\n OrderedList: 'ordered-list',\n} as const\n\nexport type RootBlockType = typeof RootBlockType[keyof typeof RootBlockType]\n\nexport const BlockType = {\n ...RootBlockType,\n ListItem: 'list-item',\n ListItemChild: 'list-item-child',\n} as const\n\nexport type BlockType = typeof BlockType[keyof typeof BlockType]\n\nexport type TextElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Text\n}\n\nexport type ParagraphElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Paragraph\n}\n\nexport type Heading1Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading1\n}\n\nexport type Heading2Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading2\n}\n\nexport type Heading3Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading3\n}\n\nexport type Heading4Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading4\n}\n\nexport type Heading5Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading5\n}\n\nexport type Heading6Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading6\n}\n\nexport type BlockQuoteElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.BlockQuote\n}\n\nexport type UnorderedListElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.UnorderedList\n}\n\nexport type OrderedListElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.OrderedList\n}\n\nexport type ListElement = OrderedListElement | UnorderedListElement\n\nexport type ListItemElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.ListItem\n}\n\nexport type ListItemChildElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.ListItemChild\n}\n\nexport const InlineType = {\n Code: 'code',\n SuperScript: 'superscript',\n SubScript: 'subscript',\n Link: 'link',\n} as const\n\nexport type InlineType = typeof InlineType[keyof typeof InlineType]\n\nexport const BlockTextAlignment = {\n Left: 'left',\n Center: 'center',\n Right: 'right',\n Justify: 'justify',\n} as const\n\nexport type BlockTextAlignment = typeof BlockTextAlignment[keyof typeof BlockTextAlignment]\n\nexport type ResponsiveBlockTextAlignment = ResponsiveValue<BlockTextAlignment>\n\nexport type CodeElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.Code\n}\n\nexport type SuperElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.SuperScript\n}\n\nexport type SubElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.SubScript\n}\n\nexport type LinkElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.Link\n link: LinkControlData\n}\n\nexport type RootBlock =\n | TextElement\n | ParagraphElement\n | Heading1Element\n | Heading2Element\n | Heading3Element\n | Heading4Element\n | Heading5Element\n | Heading6Element\n | BlockQuoteElement\n | ListElement\n\nexport type Block = RootBlock | ListItemElement | ListItemChildElement\n\nexport type Inline = CodeElement | SuperElement | SubElement | LinkElement\n\nexport type Element = Block | Inline\n\nexport type RichTextDAO = Descendant[]\n\nexport type MakeswiftEditor = BaseEditor & ReactEditor & HistoryEditor & BuilderEditor\n\ndeclare module 'slate' {\n interface CustomTypes {\n Editor: MakeswiftEditor\n Element: Element\n Text: Text\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAiCO,MAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AACf;AAIO,MAAM,YAAY,iCACpB,gBADoB;AAAA,EAEvB,UAAU;AAAA,EACV,eAAe;AACjB;AAoFO,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,WAAW;AAAA,EACX,MAAM;AACR;;"}
|
|
@@ -88,7 +88,7 @@ declare const Button: import("react").ForwardRefExoticComponent<BaseProps<Elemen
|
|
|
88
88
|
};
|
|
89
89
|
}) | undefined;
|
|
90
90
|
onClick?: ((event: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>) => unknown) | undefined;
|
|
91
|
-
}> & import("react").RefAttributes<HTMLAnchorElement>, "type" | "property" | "key" | "is" | "id" | "color" | "translate" | "style" | "children" | "hidden" | "defaultValue" | "resource" | "slot" | "title" | "dir" | "rel" | "href" | "itemProp" | "dangerouslySetInnerHTML" | "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" | "
|
|
91
|
+
}> & import("react").RefAttributes<HTMLAnchorElement>, "type" | "property" | "key" | "is" | "id" | "color" | "translate" | "style" | "onChange" | "children" | "hidden" | "defaultValue" | "resource" | "slot" | "title" | "dir" | "rel" | "href" | "itemProp" | "dangerouslySetInnerHTML" | "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" | "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" | "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" | "referrerPolicy" | "download" | "hrefLang" | "media" | "ping" | "target" | keyof {
|
|
92
92
|
link?: ({
|
|
93
93
|
type: "OPEN_PAGE";
|
|
94
94
|
payload: {
|
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" | "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" | "
|
|
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" | "onChange" | "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" | "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":"editable-text.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/builtin/Text/EditableText/editable-text.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAA;AAGxF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;
|
|
1
|
+
{"version":3,"file":"editable-text.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/builtin/Text/EditableText/editable-text.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAA;AAGxF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;AAazF,aAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAID,eAAO,MAAM,YAAY,sHAqFvB,CAAA;AAEF,eAAe,YAAY,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { Text } from 'slate';
|
|
3
3
|
import type { ElementIDValue, RichTextValue } from '../../../prop-controllers/descriptors';
|
|
4
|
+
import { Inline, Block } from '../../../../types/slate';
|
|
4
5
|
declare type Props = {
|
|
5
6
|
id?: ElementIDValue;
|
|
6
7
|
text?: RichTextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadOnlyText.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Text/ReadOnlyText.tsx"],"names":[],"mappings":";AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"ReadOnlyText.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Text/ReadOnlyText.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAc,IAAI,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAM1F,OAAO,EAAE,MAAM,EAAc,KAAK,EAAa,MAAM,yBAAyB,CAAA;AAG9E,aAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,QAAA,MAAM,YAAY,kGAYhB,CAAA;AAEF,eAAe,YAAY,CAAA;AAmB3B,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,IAAI,CAAA;CACjB;AAED,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,EAAE,SAAS,eASpD;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;CACnB;AAoCD,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,KAAK,CAAA;CAClB;AAED,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE,UAAU,eAgGtD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RenderElementProps } from 'slate-react';
|
|
3
|
-
import { Block } from '
|
|
3
|
+
import { Block } from '../../../../../../types/slate';
|
|
4
4
|
export interface InlineRenderElementProps extends RenderElementProps {
|
|
5
5
|
element: Block;
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/builtin/Text/components/Element/block.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/builtin/Text/components/Element/block.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,EAAE,KAAK,EAAa,MAAM,+BAA+B,CAAA;AAEhE,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,OAAO,EAAE,KAAK,CAAA;CACf;AAED,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,wBAAwB,eAiGvF"}
|