@os-design/editor 1.0.260 → 1.0.262
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/@types/emotion.d.js +1 -0
- package/dist/{types/Editor → Editor}/BlockToolbar.d.ts +2 -2
- package/dist/Editor/BlockToolbar.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/BlockToolbar.js +12 -9
- package/dist/{types/Editor → Editor}/StyleToolbar.d.ts +2 -2
- package/dist/Editor/StyleToolbar.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/StyleToolbar.js +19 -17
- package/dist/Editor/Toolbar.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/Toolbar.js +1 -2
- package/dist/Editor/ToolbarButton.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/ToolbarButton.js +6 -6
- package/dist/Editor/blocks/Figure.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/blocks/Figure.js +1 -2
- package/dist/Editor/blocks/FigureCaption.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/blocks/FigureCaption.js +1 -2
- package/dist/{types/Editor → Editor}/blocks/imageBlock.d.ts +1 -1
- package/dist/Editor/blocks/imageBlock.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/blocks/imageBlock.js +22 -15
- package/dist/Editor/blocks/types.d.ts.map +1 -0
- package/dist/Editor/blocks/types.js +1 -0
- package/dist/{types/Editor → Editor}/blocks/videoBlock.d.ts +1 -1
- package/dist/Editor/blocks/videoBlock.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/blocks/videoBlock.js +17 -13
- package/dist/Editor/decorators/linkDecorator.d.ts +4 -0
- package/dist/Editor/decorators/linkDecorator.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/decorators/linkDecorator.js +6 -6
- package/dist/{types/Editor → Editor}/hooks/useBlockToolbarProps.d.ts +3 -0
- package/dist/Editor/hooks/useBlockToolbarProps.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/hooks/useBlockToolbarProps.js +2 -3
- package/dist/{types/Editor → Editor}/hooks/usePastedTextHandler.d.ts +4 -1
- package/dist/Editor/hooks/usePastedTextHandler.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/hooks/usePastedTextHandler.js +1 -2
- package/dist/{types/Editor → Editor}/hooks/useReturnHandler.d.ts +4 -1
- package/dist/Editor/hooks/useReturnHandler.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/hooks/useReturnHandler.js +3 -4
- package/dist/{types/Editor → Editor}/hooks/useStyleToolbarProps.d.ts +3 -0
- package/dist/Editor/hooks/useStyleToolbarProps.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/hooks/useStyleToolbarProps.js +2 -3
- package/dist/Editor/index.d.ts +42 -0
- package/dist/Editor/index.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/index.js +51 -47
- package/dist/Editor/styles/defaultDraftJsStyles.d.ts +7 -0
- package/dist/Editor/styles/defaultDraftJsStyles.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/styles/defaultDraftJsStyles.js +1 -2
- package/dist/{types/Editor → Editor}/styles/overrideDraftJsStyles.d.ts +1 -1
- package/dist/Editor/styles/overrideDraftJsStyles.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/styles/overrideDraftJsStyles.js +1 -4
- package/dist/Editor/utils/addNewBlockAt.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/utils/addNewBlockAt.js +1 -2
- package/dist/Editor/utils/changeBlock.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/utils/changeBlock.js +1 -2
- package/dist/Editor/utils/createContentEditorState.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/utils/createContentEditorState.js +2 -3
- package/dist/Editor/utils/createDecorator.d.ts.map +1 -0
- package/dist/Editor/utils/createDecorator.js +4 -0
- package/dist/Editor/utils/createEmptyEditorState.d.ts.map +1 -0
- package/dist/Editor/utils/createEmptyEditorState.js +4 -0
- package/dist/Editor/utils/defaultStyleToolbarItems.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/utils/defaultStyleToolbarItems.js +8 -8
- package/dist/Editor/utils/getCurrentBlock.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/utils/getCurrentBlock.js +1 -2
- package/dist/Editor/utils/getSelectedBlockElement.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/utils/getSelectedBlockElement.js +2 -3
- package/dist/Editor/utils/getSelectionRange.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/utils/getSelectionRange.js +1 -2
- package/dist/Editor/utils/setLink.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/utils/setLink.js +1 -2
- package/dist/Editor/utils/transformers.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/utils/transformers.js +1 -2
- package/dist/Editor/utils/unsetLink.d.ts.map +1 -0
- package/dist/{esm/Editor → Editor}/utils/unsetLink.js +1 -2
- package/dist/EditorSkeleton/index.d.ts +8 -0
- package/dist/EditorSkeleton/index.d.ts.map +1 -0
- package/dist/EditorSkeleton/index.js +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/package.json +12 -13
- package/src/@types/emotion.d.ts +1 -1
- package/src/Editor/BlockToolbar.tsx +2 -2
- package/src/Editor/StyleToolbar.tsx +2 -3
- package/src/Editor/blocks/imageBlock.tsx +1 -1
- package/src/Editor/blocks/videoBlock.tsx +1 -3
- package/src/Editor/decorators/linkDecorator.tsx +1 -2
- package/src/Editor/hooks/usePastedTextHandler.ts +2 -2
- package/src/Editor/hooks/useReturnHandler.ts +1 -1
- package/src/Editor/index.tsx +5 -5
- package/src/Editor/styles/overrideDraftJsStyles.ts +0 -1
- package/src/EditorSkeleton/index.tsx +2 -2
- package/dist/cjs/@types/emotion.d.js +0 -4
- package/dist/cjs/@types/emotion.d.js.map +0 -1
- package/dist/cjs/Editor/BlockToolbar.js +0 -44
- package/dist/cjs/Editor/BlockToolbar.js.map +0 -1
- package/dist/cjs/Editor/StyleToolbar.js +0 -65
- package/dist/cjs/Editor/StyleToolbar.js.map +0 -1
- package/dist/cjs/Editor/Toolbar.js +0 -18
- package/dist/cjs/Editor/Toolbar.js.map +0 -1
- package/dist/cjs/Editor/ToolbarButton.js +0 -47
- package/dist/cjs/Editor/ToolbarButton.js.map +0 -1
- package/dist/cjs/Editor/blocks/Figure.js +0 -16
- package/dist/cjs/Editor/blocks/Figure.js.map +0 -1
- package/dist/cjs/Editor/blocks/FigureCaption.js +0 -21
- package/dist/cjs/Editor/blocks/FigureCaption.js.map +0 -1
- package/dist/cjs/Editor/blocks/imageBlock.js +0 -156
- package/dist/cjs/Editor/blocks/imageBlock.js.map +0 -1
- package/dist/cjs/Editor/blocks/types.js +0 -2
- package/dist/cjs/Editor/blocks/types.js.map +0 -1
- package/dist/cjs/Editor/blocks/videoBlock.js +0 -82
- package/dist/cjs/Editor/blocks/videoBlock.js.map +0 -1
- package/dist/cjs/Editor/decorators/linkDecorator.js +0 -29
- package/dist/cjs/Editor/decorators/linkDecorator.js.map +0 -1
- package/dist/cjs/Editor/hooks/useBlockToolbarProps.js +0 -69
- package/dist/cjs/Editor/hooks/useBlockToolbarProps.js.map +0 -1
- package/dist/cjs/Editor/hooks/usePastedTextHandler.js +0 -26
- package/dist/cjs/Editor/hooks/usePastedTextHandler.js.map +0 -1
- package/dist/cjs/Editor/hooks/useReturnHandler.js +0 -27
- package/dist/cjs/Editor/hooks/useReturnHandler.js.map +0 -1
- package/dist/cjs/Editor/hooks/useStyleToolbarProps.js +0 -56
- package/dist/cjs/Editor/hooks/useStyleToolbarProps.js.map +0 -1
- package/dist/cjs/Editor/index.js +0 -156
- package/dist/cjs/Editor/index.js.map +0 -1
- package/dist/cjs/Editor/styles/defaultDraftJsStyles.js +0 -16
- package/dist/cjs/Editor/styles/defaultDraftJsStyles.js.map +0 -1
- package/dist/cjs/Editor/styles/overrideDraftJsStyles.js +0 -16
- package/dist/cjs/Editor/styles/overrideDraftJsStyles.js.map +0 -1
- package/dist/cjs/Editor/utils/addNewBlockAt.js +0 -48
- package/dist/cjs/Editor/utils/addNewBlockAt.js.map +0 -1
- package/dist/cjs/Editor/utils/changeBlock.js +0 -22
- package/dist/cjs/Editor/utils/changeBlock.js.map +0 -1
- package/dist/cjs/Editor/utils/createContentEditorState.js +0 -14
- package/dist/cjs/Editor/utils/createContentEditorState.js.map +0 -1
- package/dist/cjs/Editor/utils/createDecorator.js +0 -14
- package/dist/cjs/Editor/utils/createDecorator.js.map +0 -1
- package/dist/cjs/Editor/utils/createEmptyEditorState.js +0 -14
- package/dist/cjs/Editor/utils/createEmptyEditorState.js.map +0 -1
- package/dist/cjs/Editor/utils/defaultStyleToolbarItems.js +0 -40
- package/dist/cjs/Editor/utils/defaultStyleToolbarItems.js.map +0 -1
- package/dist/cjs/Editor/utils/getCurrentBlock.js +0 -13
- package/dist/cjs/Editor/utils/getCurrentBlock.js.map +0 -1
- package/dist/cjs/Editor/utils/getSelectedBlockElement.js +0 -20
- package/dist/cjs/Editor/utils/getSelectedBlockElement.js.map +0 -1
- package/dist/cjs/Editor/utils/getSelectionRange.js +0 -13
- package/dist/cjs/Editor/utils/getSelectionRange.js.map +0 -1
- package/dist/cjs/Editor/utils/setLink.js +0 -22
- package/dist/cjs/Editor/utils/setLink.js.map +0 -1
- package/dist/cjs/Editor/utils/transformers.js +0 -16
- package/dist/cjs/Editor/utils/transformers.js.map +0 -1
- package/dist/cjs/Editor/utils/unsetLink.js +0 -15
- package/dist/cjs/Editor/utils/unsetLink.js.map +0 -1
- package/dist/cjs/EditorSkeleton/index.js +0 -31
- package/dist/cjs/EditorSkeleton/index.js.map +0 -1
- package/dist/cjs/index.js +0 -146
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/@types/emotion.d.js +0 -2
- package/dist/esm/@types/emotion.d.js.map +0 -1
- package/dist/esm/Editor/BlockToolbar.js.map +0 -1
- package/dist/esm/Editor/StyleToolbar.js.map +0 -1
- package/dist/esm/Editor/Toolbar.js.map +0 -1
- package/dist/esm/Editor/ToolbarButton.js.map +0 -1
- package/dist/esm/Editor/blocks/Figure.js.map +0 -1
- package/dist/esm/Editor/blocks/FigureCaption.js.map +0 -1
- package/dist/esm/Editor/blocks/imageBlock.js.map +0 -1
- package/dist/esm/Editor/blocks/types.js +0 -2
- package/dist/esm/Editor/blocks/types.js.map +0 -1
- package/dist/esm/Editor/blocks/videoBlock.js.map +0 -1
- package/dist/esm/Editor/decorators/linkDecorator.js.map +0 -1
- package/dist/esm/Editor/hooks/useBlockToolbarProps.js.map +0 -1
- package/dist/esm/Editor/hooks/usePastedTextHandler.js.map +0 -1
- package/dist/esm/Editor/hooks/useReturnHandler.js.map +0 -1
- package/dist/esm/Editor/hooks/useStyleToolbarProps.js.map +0 -1
- package/dist/esm/Editor/index.js.map +0 -1
- package/dist/esm/Editor/styles/defaultDraftJsStyles.js.map +0 -1
- package/dist/esm/Editor/styles/overrideDraftJsStyles.js.map +0 -1
- package/dist/esm/Editor/utils/addNewBlockAt.js.map +0 -1
- package/dist/esm/Editor/utils/changeBlock.js.map +0 -1
- package/dist/esm/Editor/utils/createContentEditorState.js.map +0 -1
- package/dist/esm/Editor/utils/createDecorator.js +0 -5
- package/dist/esm/Editor/utils/createDecorator.js.map +0 -1
- package/dist/esm/Editor/utils/createEmptyEditorState.js +0 -5
- package/dist/esm/Editor/utils/createEmptyEditorState.js.map +0 -1
- package/dist/esm/Editor/utils/defaultStyleToolbarItems.js.map +0 -1
- package/dist/esm/Editor/utils/getCurrentBlock.js.map +0 -1
- package/dist/esm/Editor/utils/getSelectedBlockElement.js.map +0 -1
- package/dist/esm/Editor/utils/getSelectionRange.js.map +0 -1
- package/dist/esm/Editor/utils/setLink.js.map +0 -1
- package/dist/esm/Editor/utils/transformers.js.map +0 -1
- package/dist/esm/Editor/utils/unsetLink.js.map +0 -1
- package/dist/esm/EditorSkeleton/index.js +0 -17
- package/dist/esm/EditorSkeleton/index.js.map +0 -1
- package/dist/esm/index.js +0 -16
- package/dist/esm/index.js.map +0 -1
- package/dist/types/Editor/BlockToolbar.d.ts.map +0 -1
- package/dist/types/Editor/StyleToolbar.d.ts.map +0 -1
- package/dist/types/Editor/Toolbar.d.ts.map +0 -1
- package/dist/types/Editor/ToolbarButton.d.ts.map +0 -1
- package/dist/types/Editor/blocks/Figure.d.ts.map +0 -1
- package/dist/types/Editor/blocks/FigureCaption.d.ts.map +0 -1
- package/dist/types/Editor/blocks/imageBlock.d.ts.map +0 -1
- package/dist/types/Editor/blocks/types.d.ts.map +0 -1
- package/dist/types/Editor/blocks/videoBlock.d.ts.map +0 -1
- package/dist/types/Editor/decorators/linkDecorator.d.ts +0 -4
- package/dist/types/Editor/decorators/linkDecorator.d.ts.map +0 -1
- package/dist/types/Editor/hooks/useBlockToolbarProps.d.ts.map +0 -1
- package/dist/types/Editor/hooks/usePastedTextHandler.d.ts.map +0 -1
- package/dist/types/Editor/hooks/useReturnHandler.d.ts.map +0 -1
- package/dist/types/Editor/hooks/useStyleToolbarProps.d.ts.map +0 -1
- package/dist/types/Editor/index.d.ts +0 -16
- package/dist/types/Editor/index.d.ts.map +0 -1
- package/dist/types/Editor/styles/defaultDraftJsStyles.d.ts +0 -3
- package/dist/types/Editor/styles/defaultDraftJsStyles.d.ts.map +0 -1
- package/dist/types/Editor/styles/overrideDraftJsStyles.d.ts.map +0 -1
- package/dist/types/Editor/utils/addNewBlockAt.d.ts.map +0 -1
- package/dist/types/Editor/utils/changeBlock.d.ts.map +0 -1
- package/dist/types/Editor/utils/createContentEditorState.d.ts.map +0 -1
- package/dist/types/Editor/utils/createDecorator.d.ts.map +0 -1
- package/dist/types/Editor/utils/createEmptyEditorState.d.ts.map +0 -1
- package/dist/types/Editor/utils/defaultStyleToolbarItems.d.ts.map +0 -1
- package/dist/types/Editor/utils/getCurrentBlock.d.ts.map +0 -1
- package/dist/types/Editor/utils/getSelectedBlockElement.d.ts.map +0 -1
- package/dist/types/Editor/utils/getSelectionRange.d.ts.map +0 -1
- package/dist/types/Editor/utils/setLink.d.ts.map +0 -1
- package/dist/types/Editor/utils/transformers.d.ts.map +0 -1
- package/dist/types/Editor/utils/unsetLink.d.ts.map +0 -1
- package/dist/types/EditorSkeleton/index.d.ts +0 -6
- package/dist/types/EditorSkeleton/index.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- /package/dist/{types/Editor → Editor}/Toolbar.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/ToolbarButton.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/blocks/Figure.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/blocks/FigureCaption.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/blocks/types.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/addNewBlockAt.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/changeBlock.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/createContentEditorState.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/createDecorator.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/createEmptyEditorState.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/defaultStyleToolbarItems.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/getCurrentBlock.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/getSelectedBlockElement.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/getSelectionRange.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/setLink.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/transformers.d.ts +0 -0
- /package/dist/{types/Editor → Editor}/utils/unsetLink.d.ts +0 -0
- /package/dist/{types/index.d.ts → index.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarButton.js","names":["css","styled","resetButtonStyles","transitionStyles","clr","omitEmotionProps","React","activeStyles","p","active","theme","editorToolbarButtonColorBgActive","StyledToolbarButton","editorToolbarButtonSize","editorToolbarButtonColorBg","editorToolbarButtonColorText","editorToolbarButtonColorBgHover","ToolbarButton","onMouseDown","rest","createElement","_extends","e","preventDefault","displayName"],"sources":["../../../src/Editor/ToolbarButton.tsx"],"sourcesContent":["import { css } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { resetButtonStyles, transitionStyles } from '@os-design/styles';\nimport { clr } from '@os-design/theming';\nimport { omitEmotionProps } from '@os-design/utils';\nimport React from 'react';\n\ntype JsxButtonProps = JSX.IntrinsicElements['button'];\ninterface ToolbarButtonProps extends JsxButtonProps {\n active?: boolean;\n}\n\nconst activeStyles = (p) =>\n p.active &&\n css`\n background-color: ${clr(p.theme.editorToolbarButtonColorBgActive)};\n `;\n\ntype StyledToolbarButtonProps = Pick<ToolbarButtonProps, 'active'>;\nconst StyledToolbarButton = styled(\n 'button',\n omitEmotionProps('active')\n)<StyledToolbarButtonProps>`\n ${resetButtonStyles};\n cursor: pointer;\n font-size: 1.3em;\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n width: ${(p) => p.theme.editorToolbarButtonSize}em;\n height: ${(p) => p.theme.editorToolbarButtonSize}em;\n background-color: ${(p) => clr(p.theme.editorToolbarButtonColorBg)};\n color: ${(p) => clr(p.theme.editorToolbarButtonColorText)};\n\n @media (hover: hover) {\n &:hover,\n &:focus {\n background-color: ${(p) => clr(p.theme.editorToolbarButtonColorBgHover)};\n }\n }\n\n ${activeStyles};\n ${transitionStyles('background-color')};\n`;\n\nconst ToolbarButton: React.FC<ToolbarButtonProps> = ({\n onMouseDown = () => {},\n ...rest\n}) => (\n <StyledToolbarButton\n onMouseDown={(e) => {\n onMouseDown(e);\n e.preventDefault();\n }}\n {...rest}\n />\n);\n\nToolbarButton.displayName = 'ToolbarButton';\n\nexport default ToolbarButton;\n"],"mappings":";AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,iBAAiB,EAAEC,gBAAgB,QAAQ,mBAAmB;AACvE,SAASC,GAAG,QAAQ,oB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
{"version":3,"file":"Figure.js","names":["styled","Figure","figure","p","theme","borderRadius","displayName"],"sources":["../../../../src/Editor/blocks/Figure.tsx"],"sourcesContent":["import styled from '@emotion/styled';\n\nconst Figure = styled.figure`\n border-radius: ${(p) => p.theme.borderRadius}em;\n overflow: hidden;\n`;\n\nFigure.displayName = 'Figure';\n\nexport default Figure;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,MAAMC,MAAM,GAAGD,MAAM,CAACE,MAAM;AAC5B,mBAAoBC,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACC,YAAY;AAC9C;AACA,CAAC;AAEDJ,MAAM,CAACK,WAAW,GAAG,QAAQ;AAE7B,eAAeL,MAAM","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FigureCaption.js","names":["styled","clr","FigureCaption","figcaption","p","theme","sizes","small","editorFigureCaptionColorBg","editorFigureCaptionColorText","displayName"],"sources":["../../../../src/Editor/blocks/FigureCaption.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { clr } from '@os-design/theming';\n\nconst FigureCaption = styled.figcaption`\n font-size: ${(p) => p.theme.sizes.small}em;\n padding: 0.4em 0.8em;\n\n background-color: ${(p) => clr(p.theme.editorFigureCaptionColorBg)};\n color: ${(p) => clr(p.theme.editorFigureCaptionColorText)};\n\n & > div {\n text-align: center !important;\n margin: 0 !important;\n }\n`;\n\nFigureCaption.displayName = 'FigureCaption';\n\nexport default FigureCaption;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAASC,GAAG,QAAQ,oBAAoB;AAExC,MAAMC,aAAa,GAAGF,MAAM,CAACG,UAAU;AACvC,eAAgBC,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACC,KAAK,CAACC,KAAK;AACzC;AACA;AACA,sBAAuBH,CAAC,IAAKH,GAAG,CAACG,CAAC,CAACC,KAAK,CAACG,0BAA0B,CAAC;AACpE,WAAYJ,CAAC,IAAKH,GAAG,CAACG,CAAC,CAACC,KAAK,CAACI,4BAA4B,CAAC;AAC3D;AACA;AACA;AACA;AACA;AACA,CAAC;AAEDP,aAAa,CAACQ,WAAW,GAAG,eAAe;AAE3C,eAAeR,aAAa","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imageBlock.js","names":["css","styled","message","Loading","Picture","omitEmotionProps","useEvent","EditorBlock","React","useCallback","useRef","useState","changeBlock","getCurrentBlock","Figure","FigureCaption","widthStyles","p","width","ImageFigure","Mask","div","theme","editorBlockImageMaskOpacity","LoadingIcon","editorBlockImageLoadingFontSize","Image","img","editorBlockImageMaxHeight","ImageBlock","props","block","data","getData","src","get","loading","imageRef","setWidth","updateWidth","current","window","undefined","createElement","startsWith","alt","getText","onLoad","ref","IMAGE_BLOCK","imageBlock","onImageUpload","type","component","icon","onClick","value","onChange","setReadOnly","Error","input","document","accept","onchange","e","target","files","file","URL","createObjectURL","currentBlock","nextEditorState","err","error","click"],"sources":["../../../../src/Editor/blocks/imageBlock.tsx"],"sourcesContent":["import { css } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { message } from '@os-design/core';\nimport { Loading, Picture } from '@os-design/icons';\nimport { omitEmotionProps, useEvent } from '@os-design/utils';\nimport { EditorBlock } from 'draft-js';\nimport React, { useCallback, useRef, useState } from 'react';\nimport changeBlock from '../utils/changeBlock';\nimport getCurrentBlock from '../utils/getCurrentBlock';\nimport Figure from './Figure';\nimport FigureCaption from './FigureCaption';\nimport { BlockProps, BlockToolbarItem } from './types';\n\nconst widthStyles = (p) =>\n p.width &&\n css`\n width: ${p.width}px;\n `;\n\ninterface ImageFigureProps {\n width: number;\n}\nconst ImageFigure = styled(Figure, omitEmotionProps('width'))<ImageFigureProps>`\n position: relative;\n display: inline-block;\n max-width: 100%;\n ${widthStyles};\n`;\n\nconst Mask = styled.div`\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n background-color: hsla(\n 0,\n 0%,\n 0%,\n ${(p) => p.theme.editorBlockImageMaskOpacity}\n );\n color: hsl(0, 0%, 100%);\n`;\n\nconst LoadingIcon = styled(Loading)`\n font-size: ${(p) => p.theme.editorBlockImageLoadingFontSize}em;\n`;\n\nconst Image = styled.img`\n max-width: 100%;\n max-height: ${(p) => p.theme.editorBlockImageMaxHeight}em;\n vertical-align: bottom;\n`;\n\nconst ImageBlock: React.FC<BlockProps> = (props) => {\n const { block } = props;\n const data = block.getData();\n const src = data.get('src') as string;\n const loading = data.get('loading') as boolean;\n\n // Update the width of the image\n const imageRef = useRef<HTMLImageElement>(null);\n const [width, setWidth] = useState(0);\n const updateWidth = useCallback(() => {\n if (!imageRef.current) return;\n setWidth(imageRef.current.width);\n }, []);\n useEvent(\n (typeof window !== 'undefined' ? window : undefined) as EventTarget,\n 'resize',\n updateWidth\n );\n\n if (!src) return null;\n\n return (\n <ImageFigure width={width}>\n {loading && (\n <Mask>\n <LoadingIcon />\n </Mask>\n )}\n <Image\n src={src.startsWith('blob:') ? src : `${src}-1024`}\n alt={block.getText()}\n onLoad={updateWidth}\n ref={imageRef}\n />\n {!loading && (\n <FigureCaption>\n <EditorBlock {...props} />\n </FigureCaption>\n )}\n </ImageFigure>\n );\n};\n\nexport const IMAGE_BLOCK = 'atomic:image';\n\nconst imageBlock = (\n onImageUpload: (file: File) => Promise<string>\n): BlockToolbarItem => ({\n type: IMAGE_BLOCK,\n component: ImageBlock,\n icon: <Picture />,\n onClick: ({ value, onChange, setReadOnly }) => {\n if (!onImageUpload) throw new Error('Specify the onImageUpload method');\n\n // Not working in mobile Safari.\n // The input must be actually appended to the DOM.\n const input = document.createElement('input');\n input.type = 'file';\n input.accept = 'image/jpeg,image/png,image/webp';\n input.onchange = async (e) => {\n const target = e.target as HTMLInputElement | null;\n if (!target) return;\n const { files } = target;\n if (!files) return;\n\n setReadOnly(true);\n const file = files[0];\n let src = URL.createObjectURL(file);\n\n // Add the local image\n const currentBlock = getCurrentBlock(value);\n let nextEditorState = changeBlock(value, currentBlock, IMAGE_BLOCK, {\n src,\n loading: true,\n });\n onChange(nextEditorState);\n\n // Replace the local image with the remote one\n try {\n src = await onImageUpload(file);\n nextEditorState = changeBlock(value, currentBlock, IMAGE_BLOCK, {\n src,\n });\n } catch (err) {\n if (err instanceof Error) {\n message.error(err.message);\n }\n nextEditorState = changeBlock(value, currentBlock, 'unstyled');\n }\n\n setReadOnly(false);\n onChange(nextEditorState);\n };\n input.click();\n },\n});\n\nexport default imageBlock;\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,OAAO,EAAEC,OAAO,QAAQ,kBAAkB;AACnD,SAASC,gBAAgB,EAAEC,QAAQ,QAAQ,kBAAkB;AAC7D,SAASC,WAAW,QAAQ,UAAU;AACtC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,eAAe,MAAM,0BAA0B;AACtD,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,aAAa,MAAM,iBAAiB;AAG3C,MAAMC,WAAW,GAAIC,CAAC,IACpBA,CAAC,CAACC,KAAK,IACPlB,GAAG;AACL,aAAaiB,CAAC,CAACC,KAAK;AACpB,GAAG;AAKH,MAAMC,WAAW,GAAGlB,MAAM,CAACa,MAAM,EAAET,gBAAgB,CAAC,OAAO,CAAC,CAAmB;AAC/E;AACA;AACA;AACA,IAAIW,WAAW;AACf,CAAC;AAED,MAAMI,IAAI,GAAGnB,MAAM,CAACoB,GAAG;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAOJ,CAAC,IAAKA,CAAC,CAACK,KAAK,CAACC,2BAA2B;AAChD;AACA;AACA,C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zD,eAAe,CAAC2C,KAAK,CAAC;MAC3C,IAAIe,eAAe,GAAG3D,WAAW,CAAC4C,KAAK,EAAEc,YAAY,EAAErB,WAAW,EAAE;QAClEf,GAAG;QACHE,OAAO,EAAE;MACX,CAAC,CAAC;MACFqB,QAAQ,CAACc,eAAe,CAAC;;MAEzB;MACA,IAAI;QACFrC,GAAG,GAAG,MAAMiB,aAAa,CAACgB,IAAI,CAAC;QAC/BI,eAAe,GAAG3D,WAAW,CAAC4C,KAAK,EAAEc,YAAY,EAAErB,WAAW,EAAE;UAC9Df;QACF,CAAC,CAAC;MACJ,CAAC,CAAC,OAAOsC,GAAG,EAAE;QACZ,IAAIA,GAAG,YAAYb,KAAK,EAAE;UACxBzD,OAAO,CAACuE,KAAK,CAACD,GAAG,CAACtE,OAAO,CAAC;QAC5B;QACAqE,eAAe,GAAG3D,WAAW,CAAC4C,KAAK,EAAEc,YAAY,EAAE,UAAU,CAAC;MAChE;MAEAZ,WAAW,CAAC,KAAK,CAAC;MAClBD,QAAQ,CAACc,eAAe,CAAC;IAC3B,CAAC;IACDX,KAAK,CAACc,KAAK,CAAC,CAAC;EACf;AACF,CAAC,CAAC;AAEF,eAAexB,UAAU","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/Editor/blocks/types.ts"],"sourcesContent":["import { ContentBlock, EditorState } from 'draft-js';\nimport React from 'react';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface BlockProps extends Record<string, any> {\n block: ContentBlock;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface BlockToolbarItemOnClickProps extends Record<string, any> {\n value: EditorState;\n onChange: (value: EditorState) => void;\n setReadOnly: (readOnly: boolean) => void;\n}\n\nexport interface BlockToolbarItem {\n type: string;\n component: React.FC<BlockProps>;\n icon: React.ReactElement;\n onClick: (props: BlockToolbarItemOnClickProps) => void;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"videoBlock.js","names":["Video","VideoIcon","EditorBlock","React","changeBlock","getCurrentBlock","Figure","FigureCaption","VideoBlock","props","block","data","getData","src","get","createElement","title","getText","videoTypes","re","getUrl","id","detectVideo","url","groups","match","VIDEO_BLOCK","videoBlock","type","component","icon","onClick","value","onChange","prompt","currentBlock","nextEditorState"],"sources":["../../../../src/Editor/blocks/videoBlock.tsx"],"sourcesContent":["import { Video } from '@os-design/core';\nimport { Video as VideoIcon } from '@os-design/icons';\nimport { EditorBlock } from 'draft-js';\nimport React from 'react';\nimport changeBlock from '../utils/changeBlock';\nimport getCurrentBlock from '../utils/getCurrentBlock';\nimport Figure from './Figure';\nimport FigureCaption from './FigureCaption';\nimport { BlockProps, BlockToolbarItem } from './types';\n\nconst VideoBlock: React.FC<BlockProps> = (props) => {\n const { block } = props;\n const data = block.getData();\n const src = data.get('src');\n\n if (!src) return null;\n\n return (\n <Figure>\n <Video src={src} title={block.getText()} />\n <FigureCaption>\n <EditorBlock {...props} />\n </FigureCaption>\n </Figure>\n );\n};\n\nconst videoTypes = [\n /**\n * YouTube. Supported formats:\n * https://www.youtube.com/watch?v=FJIhWbUt600&ab_channel=IlyaOrdin\n * https://www.youtube.com/embed/FJIhWbUt600\n * https://youtu.be/FJIhWbUt600\n */\n {\n re: /^https:\\/\\/(?:www\\.youtube\\.com\\/(?:watch\\?v=|embed\\/)|youtu\\.be\\/)([A-z0-9-_]*).*$/,\n getUrl: (id: string) => `https://www.youtube.com/embed/${id}`,\n },\n /**\n * RuTube. Supported formats:\n * https://rutube.ru/video/d00526135b2b96d272f6d89b486036c1/\n * https://rutube.ru/play/embed/d00526135b2b96d272f6d89b486036c1\n */\n {\n re: /^https:\\/\\/rutube\\.ru\\/(?:video|play\\/embed)\\/([a-z0-9]*)\\/?$/,\n getUrl: (id: string) => `https://rutube.ru/play/embed/${id}`,\n },\n];\n\nconst detectVideo = (url: string) => {\n // eslint-disable-next-line no-restricted-syntax\n for (const { re, getUrl } of videoTypes) {\n const groups = url.match(re);\n if (groups && groups[1]) return getUrl(groups[1]);\n }\n return null;\n};\n\nexport const VIDEO_BLOCK = 'atomic:video';\n\nconst videoBlock: BlockToolbarItem = {\n type: VIDEO_BLOCK,\n component: VideoBlock,\n icon: <VideoIcon />,\n onClick: ({ value, onChange }) => {\n // eslint-disable-next-line no-alert\n const url = prompt('Insert a link to YouTube or RuTube');\n if (!url) return;\n\n const src = detectVideo(url);\n if (!src) return;\n\n const currentBlock = getCurrentBlock(value);\n const nextEditorState = changeBlock(value, currentBlock, VIDEO_BLOCK, {\n src,\n });\n\n onChange(nextEditorState);\n },\n};\n\nexport default videoBlock;\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,iBAAiB;AACvC,SAASA,KAAK,IAAIC,SAAS,QAAQ,kBAAkB;AACrD,SAASC,WAAW,QAAQ,UAAU;AACtC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,eAAe,MAAM,0BAA0B;AACtD,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,aAAa,MAAM,iBAAiB;AAG3C,MAAMC,UAAgC,GAAIC,KAAK,IAAK;EAClD,MAAM;IAAEC;EAAM,CAAC,GAAGD,KAAK;EACvB,MAAME,IAAI,GAAGD,KAAK,CAACE,OAAO,CAAC,CAAC;EAC5B,MAAMC,GAAG,GAAGF,IAAI,CAACG,GAAG,CAAC,KAAK,CAAC;EAE3B,IAAI,CAACD,GAAG,EAAE,OAAO,IAAI;EAErB,oBACEV,KAAA,CAAAY,aAAA,CAACT,MAAM,qBACLH,KAAA,CAAAY,aAAA,CAACf,KAAK;IAACa,GAAG,EAAEA,GAAI;IAACG,KAAK,EAAEN,KAAK,CAACO,OAAO,CAAC;EAAE,CAAE,CAAC,eAC3Cd,KAAA,CAAAY,aAAA,CAACR,aAAa,qBACZJ,KAAA,CAAAY,aAAA,CAACb,WAAW,EAA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AAC;EAC3B;AACF,CAAC;AAED,eAAeT,UAAU","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linkDecorator.js","names":["Link","React","linkDecorator","strategy","contentBlock","callback","contentState","findEntityRanges","character","entityKey","getEntity","getType","component","children","url","getData","createElement","href"],"sources":["../../../../src/Editor/decorators/linkDecorator.tsx"],"sourcesContent":["import { Link } from '@os-design/core';\nimport { DraftDecorator } from 'draft-js';\nimport React from 'react';\n\nconst linkDecorator: DraftDecorator = {\n strategy: (contentBlock, callback, contentState) =>\n contentBlock.findEntityRanges((character) => {\n const entityKey = character.getEntity();\n return (\n entityKey !== null &&\n contentState.getEntity(entityKey).getType() === 'LINK'\n );\n }, callback),\n\n component: ({ contentState, entityKey, children }) => {\n const { url } = contentState.getEntity(entityKey).getData();\n return <Link href={url}>{children}</Link>;\n },\n};\n\nexport default linkDecorator;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,iBAAiB;AAEtC,OAAOC,KAAK,MAAM,OAAO;AAEzB,MAAMC,aAA6B,GAAG;EACpCC,QAAQ,EAAEA,CAACC,YAAY,EAAEC,QAAQ,EAAEC,YAAY,KAC7CF,YAAY,CAACG,gBAAgB,CAAEC,SAAS,IAAK;IAC3C,MAAMC,SAAS,GAAGD,SAAS,CAACE,SAAS,CAAC,CAAC;IACvC,OACED,SAAS,KAAK,IAAI,IAClBH,YAAY,CAACI,SAAS,CAACD,SAAS,CAAC,CAACE,OAAO,CAAC,CAAC,KAAK,MAAM;EAE1D,CAAC,EAAEN,QAAQ,CAAC;EAEdO,SAAS,EAAEA,CAAC;IAAEN,YAAY;IAAEG,SAAS;IAAEI;EAAS,CAAC,KAAK;IACpD,MAAM;MAAEC;IAAI,CAAC,GAAGR,YAAY,CAACI,SAAS,CAACD,SAAS,CAAC,CAACM,OAAO,CAAC,CAAC;IAC3D,oBAAOd,KAAA,CAAAe,aAAA,CAAChB,IAAI;MAACiB,IAAI,EAAEH;IAAI,GAAED,QAAe,CAAC;EAC3C;AACF,CAAC;AAED,eAAeX,aAAa","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBlockToolbarProps.js","names":["useEffect","useState","getSelectedBlockElement","useBlockToolbarProps","value","show","trigger","setTrigger","top","left","width","height","visible","setVisible","selectedBlockElement","selectionState","getSelection","currentBlockKey","getStartKey","contentState","getCurrentContent","currentBlock","getBlockForKey","lineNumber","getBlockMap","keySeq","findIndex","k","getType","getLength","getBoundingClientRect"],"sources":["../../../../src/Editor/hooks/useBlockToolbarProps.ts"],"sourcesContent":["import { EditorState } from 'draft-js';\nimport { useEffect, useState } from 'react';\nimport getSelectedBlockElement from '../utils/getSelectedBlockElement';\n\ninterface Rect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\ninterface UseBlockToolbarPropsRes {\n trigger: Rect;\n visible: boolean;\n}\n\n/**\n * Updates the visibility of the block toolbar.\n */\nconst useBlockToolbarProps = (\n value: EditorState,\n show: boolean\n): UseBlockToolbarPropsRes => {\n const [trigger, setTrigger] = useState({\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n });\n const [visible, setVisible] = useState(false);\n\n useEffect(() => {\n if (!show || !value) return;\n\n const selectedBlockElement = getSelectedBlockElement();\n if (!selectedBlockElement) {\n setVisible(false);\n return;\n }\n\n const selectionState = value.getSelection();\n const currentBlockKey = selectionState.getStartKey();\n const contentState = value.getCurrentContent();\n const currentBlock = contentState.getBlockForKey(currentBlockKey);\n const lineNumber = contentState\n .getBlockMap()\n .keySeq()\n .findIndex((k) => k === currentBlockKey);\n\n if (\n currentBlock.getType() !== 'unstyled' ||\n currentBlock.getLength() > 0 ||\n lineNumber === 0\n ) {\n setVisible(false);\n return;\n }\n\n const { top, left, height } = selectedBlockElement.getBoundingClientRect();\n setTrigger({\n top,\n left,\n width: 0,\n height,\n });\n setVisible(true);\n }, [show, value]);\n\n return { trigger, visible };\n};\n\nexport default useBlockToolbarProps;\n"],"mappings":"AACA,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CAACgB,qBAAqB,CAAC,CAAC;IAC1EvB,UAAU,CAAC;MACTC,GAAG;MACHC,IAAI;MACJC,KAAK,EAAE,CAAC;MACRC;IACF,CAAC,CAAC;IACFE,UAAU,CAAC,IAAI,CAAC;EAClB,CAAC,EAAE,CAACR,IAAI,EAAED,KAAK,CAAC,CAAC;EAEjB,OAAO;IAAEE,OAAO;IAAEM;EAAQ,CAAC;AAC7B,CAAC;AAED,eAAeT,oBAAoB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePastedTextHandler.js","names":["EditorState","Modifier","RichUtils","useCallback","usePastedTextHandler","onChange","handler","text","html","editorState","currentBlockType","getCurrentBlockType","startsWith","contentState","getCurrentContent","nextContentState","insertText","getSelection","nextEditorState","push"],"sources":["../../../../src/Editor/hooks/usePastedTextHandler.ts"],"sourcesContent":["import {\n EditorProps as DraftEditorProps,\n DraftHandleValue,\n EditorState,\n Modifier,\n RichUtils,\n} from 'draft-js';\nimport { useCallback } from 'react';\n\ntype UsePastedTextHandlerRes = Exclude<\n DraftEditorProps['handlePastedText'],\n undefined\n>;\n\n/**\n * Pastes only text if the current block is atomic.\n */\nconst usePastedTextHandler = (\n onChange: (value: EditorState) => void,\n handler: UsePastedTextHandlerRes\n): UsePastedTextHandlerRes =>\n useCallback<UsePastedTextHandlerRes>(\n (text, html, editorState): DraftHandleValue => {\n const currentBlockType = RichUtils.getCurrentBlockType(editorState);\n\n if (currentBlockType.startsWith('atomic')) {\n const contentState = editorState.getCurrentContent();\n const nextContentState = Modifier.insertText(\n contentState,\n editorState.getSelection(),\n text\n );\n const nextEditorState = EditorState.push(\n editorState,\n nextContentState,\n 'insert-characters'\n );\n onChange(nextEditorState);\n return 'handled';\n }\n\n return handler(text, html, editorState);\n },\n [onChange, handler]\n );\n\nexport default usePastedTextHandler;\n"],"mappings":"AAAA,SAGEA,WAAW,EACXC,QAAQ,EACRC,SAAS,QACJ,UAAU;AACjB,SAASC,WAAW,QAAQ,OAAO;AAOnC;AACA;AACA;AACA,MAAMC,oBAAoB,GAAGA,CAC3BC,QAAsC,EACtCC,OAAgC,KAEhCH,WAAW,CACT,CAACI,IAAI,EAAEC,IAAI,EAAEC,WAAW,KAAuB;EAC7C,MAAMC,gBAAgB,GAAGR,SAAS,CAACS,mBAAmB,CAACF,WAAW,CAAC;EAEnE,IAAIC,gBAAgB,CAACE,UAAU,CAAC,QAAQ,CAAC,EAAE;IACzC,MAAMC,YAAY,GAAGJ,WAAW,CAACK,iBAAiB,CAAC,CAAC;IACpD,MAAMC,gBAAgB,GAAGd,QAAQ,CAACe,UAAU,CAC1CH,YAAY,EACZJ,WAAW,CAACQ,YAAY,CAAC,CAAC,EAC1BV,IACF,CAAC;IACD,MAAMW,eAAe,GAAGlB,WAAW,CAACmB,IAAI,CACtCV,WAAW,EACXM,gBAAgB,EAChB,mBACF,CAAC;IACDV,QAAQ,CAACa,eAAe,CAAC;IACzB,OAAO,SAAS;EAClB;EAEA,OAAOZ,OAAO,CAACC,IAAI,EAAEC,IAAI,EAAEC,WAAW,CAAC;AACzC,CAAC,EACD,CAACJ,QAAQ,EAAEC,OAAO,CACpB,CAAC;AAEH,eAAeF,oBAAoB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useReturnHandler.js","names":["useCallback","addNewBlockAt","getCurrentBlock","useReturnHandler","onChange","handler","e","editorState","currentBlock","currentBlockType","getType","startsWith","nextEditorState","getKey"],"sources":["../../../../src/Editor/hooks/useReturnHandler.ts"],"sourcesContent":["import { EditorProps as DraftEditorProps, EditorState } from 'draft-js';\nimport { useCallback } from 'react';\nimport addNewBlockAt from '../utils/addNewBlockAt';\nimport getCurrentBlock from '../utils/getCurrentBlock';\n\ntype UseReturnHandlerRes = NonNullable<DraftEditorProps['handleReturn']>;\n\n/**\n * Adds a new unstyled block if the user presses the return key.\n */\nconst useReturnHandler = (\n onChange: (value: EditorState) => void,\n handler: UseReturnHandlerRes\n): UseReturnHandlerRes =>\n useCallback<UseReturnHandlerRes>(\n (e, editorState) => {\n const currentBlock = getCurrentBlock(editorState);\n const currentBlockType = currentBlock.getType();\n\n if (\n currentBlockType.startsWith('atomic') ||\n currentBlockType.startsWith('header')\n ) {\n const nextEditorState = addNewBlockAt(\n editorState,\n currentBlock.getKey()\n );\n onChange(nextEditorState);\n return 'handled';\n }\n\n return handler(e, editorState);\n },\n [onChange, handler]\n );\n\nexport default useReturnHandler;\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,OAAO;AACnC,OAAOC,aAAa,MAAM,wBAAwB;AAClD,OAAOC,eAAe,MAAM,0BAA0B;AAItD;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CACvBC,QAAsC,EACtCC,OAA4B,KAE5BL,WAAW,CACT,CAACM,CAAC,EAAEC,WAAW,KAAK;EAClB,MAAMC,YAAY,GAAGN,eAAe,CAACK,WAAW,CAAC;EACjD,MAAME,gBAAgB,GAAGD,YAAY,CAACE,OAAO,CAAC,CAAC;EAE/C,IACED,gBAAgB,CAACE,UAAU,CAAC,QAAQ,CAAC,IACrCF,gBAAgB,CAACE,UAAU,CAAC,QAAQ,CAAC,EACrC;IACA,MAAMC,eAAe,GAAGX,aAAa,CACnCM,WAAW,EACXC,YAAY,CAACK,MAAM,CAAC,CACtB,CAAC;IACDT,QAAQ,CAACQ,eAAe,CAAC;IACzB,OAAO,SAAS;EAClB;EAEA,OAAOP,OAAO,CAACC,CAAC,EAAEC,WAAW,CAAC;AAChC,CAAC,EACD,CAACH,QAAQ,EAAEC,OAAO,CACpB,CAAC;AAEH,eAAeF,gBAAgB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useStyleToolbarProps.js","names":["RichUtils","useEffect","useState","getSelectionRange","useStyleToolbarProps","value","trigger","setTrigger","top","left","width","height","visible","setVisible","selectionRange","getSelection","isCollapsed","getCurrentBlockType","startsWith","getBoundingClientRect"],"sources":["../../../../src/Editor/hooks/useStyleToolbarProps.ts"],"sourcesContent":["import { EditorState, RichUtils } from 'draft-js';\nimport { useEffect, useState } from 'react';\nimport getSelectionRange from '../utils/getSelectionRange';\n\ninterface Rect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\ninterface UseStyleToolbarPropsRes {\n trigger: Rect;\n visible: boolean;\n}\n\n/**\n * Updates the visibility of the style toolbar\n */\nconst useStyleToolbarProps = (value: EditorState): UseStyleToolbarPropsRes => {\n const [trigger, setTrigger] = useState({\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n });\n const [visible, setVisible] = useState(false);\n\n useEffect(() => {\n if (!value) return;\n const selectionRange = getSelectionRange();\n\n // Do not show the panel if either there is no selected text,\n // or the selection range is collapsed,\n // or the selected text is in an atomic block.\n if (\n !selectionRange ||\n value.getSelection().isCollapsed() ||\n RichUtils.getCurrentBlockType(value).startsWith('atomic')\n ) {\n setVisible(false);\n return;\n }\n\n // Otherwise, set the rect of the selection range\n setTrigger(selectionRange.getBoundingClientRect());\n setVisible(true);\n }, [value]);\n\n return { trigger, visible };\n};\n\nexport default useStyleToolbarProps;\n"],"mappings":"AAAA,SAAsBA,SAAS,QAAQ,UAAU;AACjD,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,OAAOC,iBAAiB,MAAM,4BAA4B;AAc1D;AACA;AACA;AACA,MAAMC,oBAAoB,GAAIC,KAAkB,IAA8B;EAC5E,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGL,QAAQ,CAAC;IACrCM,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV,CAAC,CAAC;EACF,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGX,QAAQ,CAAC,KAAK,CAAC;EAE7CD,SAAS,CAAC,MAAM;IACd,IAAI,CAACI,KAAK,EAAE;IACZ,MAAMS,cAAc,GAAGX,iBAAiB,CAAC,CAAC;;IAE1C;IACA;IACA;IACA,IACE,CAACW,cAAc,IACfT,KAAK,CAACU,YAAY,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,IAClChB,SAAS,CAACiB,mBAAmB,CAACZ,KAAK,CAAC,CAACa,UAAU,CAAC,QAAQ,CAAC,EACzD;MACAL,UAAU,CAAC,KAAK,CAAC;MACjB;IACF;;IAEA;IACAN,UAAU,CAACO,cAAc,CAACK,qBAAqB,CAAC,CAAC,CAAC;IAClDN,UAAU,CAAC,IAAI,CAAC;EAClB,CAAC,EAAE,CAACR,KAAK,CAAC,CAAC;EAEX,OAAO;IAAEC,OAAO;IAAEM;EAAQ,CAAC;AAC7B,CAAC;AAED,eAAeR,oBAAoB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["css","styled","InputContainer","useForwardedRef","useForwardedState","Editor","DraftEditor","EditorState","React","forwardRef","useCallback","useState","BlockToolbar","StyleToolbar","useBlockToolbarProps","usePastedTextHandler","useReturnHandler","useStyleToolbarProps","defaultDraftJsStyles","overrideDraftJsStyles","createEmptyEditorState","defaultStyleToolbarItems","disabledStyles","p","disabled","Container","theme","editorPaddingVertical","inputPaddingHorizontal","editorMinHeight","styleToolbarItems","blockToolbarItems","value","defaultValue","onChange","size","readOnly","handleReturn","handlePastedText","rest","ref","editorRef","mergedEditorRef","forwardedValue","setForwardedValue","innerReadOnly","setInnerReadOnly","styleToolbarProps","blockToolbarProps","length","setEditorState","editorState","getSelection","getHasFocus","moveSelectionToEnd","blockRenderer","block","blockConfig","find","item","type","getType","component","returnHandler","pastedTextHandler","createElement","Fragment","tabIndex","role","undefined","onFocus","current","focus","_extends","blockRendererFn","stripPastedStyles","items","placement","gap","setReadOnly","displayName"],"sources":["../../../src/Editor/index.tsx"],"sourcesContent":["import { css } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { InputContainer } from '@os-design/core';\nimport { WithSize } from '@os-design/styles';\nimport { useForwardedRef, useForwardedState } from '@os-design/utils';\nimport {\n Editor as DraftEditor,\n EditorProps as DraftEditorProps,\n EditorState,\n} from 'draft-js';\nimport React, { forwardRef, useCallback, useState } from 'react';\nimport BlockToolbar from './BlockToolbar';\nimport StyleToolbar from './StyleToolbar';\nimport { BlockToolbarItem } from './blocks/types';\nimport useBlockToolbarProps from './hooks/useBlockToolbarProps';\nimport usePastedTextHandler from './hooks/usePastedTextHandler';\nimport useReturnHandler from './hooks/useReturnHandler';\nimport useStyleToolbarProps from './hooks/useStyleToolbarProps';\nimport defaultDraftJsStyles from './styles/defaultDraftJsStyles';\nimport overrideDraftJsStyles from './styles/overrideDraftJsStyles';\nimport createEmptyEditorState from './utils/createEmptyEditorState';\nimport defaultStyleToolbarItems, {\n StyleToolbarItem,\n} from './utils/defaultStyleToolbarItems';\n\nexport interface EditorProps\n extends Omit<DraftEditorProps, 'editorState' | 'onChange'>,\n WithSize {\n /**\n * Whether the editor is disabled.\n * @default false\n */\n disabled?: boolean;\n /**\n * Available styles in the toolbar.\n * @default undefined\n */\n styleToolbarItems?: StyleToolbarItem[];\n /**\n * Available blocks in the toolbar.\n * @default undefined\n */\n blockToolbarItems?: BlockToolbarItem[];\n /**\n * The editor state.\n * @default undefined\n */\n value?: EditorState;\n /**\n * The default value.\n * @default undefined\n */\n defaultValue?: EditorState;\n /**\n * The change event handler.\n * @default undefined\n */\n onChange?: (value: EditorState) => void;\n}\n\nconst disabledStyles = (p) =>\n p.disabled &&\n css`\n cursor: not-allowed;\n `;\n\nconst Container = styled(InputContainer)`\n height: unset;\n cursor: text;\n\n padding: ${(p) => p.theme.editorPaddingVertical}em\n ${(p) => p.theme.inputPaddingHorizontal}em;\n min-height: ${(p) => p.theme.editorMinHeight}em;\n\n ${defaultDraftJsStyles};\n ${overrideDraftJsStyles};\n ${disabledStyles};\n`;\n\n/**\n * Rich text editor based on the Draft.js.\n */\nconst Editor = forwardRef<DraftEditor, EditorProps>(\n (\n {\n disabled = false,\n styleToolbarItems = defaultStyleToolbarItems,\n blockToolbarItems = [],\n value,\n defaultValue = createEmptyEditorState(),\n onChange,\n size,\n readOnly,\n handleReturn = () => 'not-handled',\n handlePastedText = () => 'not-handled',\n ...rest\n },\n ref\n ) => {\n const [editorRef, mergedEditorRef] = useForwardedRef(ref);\n const [forwardedValue, setForwardedValue] = useForwardedState({\n value,\n defaultValue,\n onChange,\n });\n\n // Used by ImageBlock to make the editor read-only\n // while an image is being uploaded\n const [innerReadOnly, setInnerReadOnly] = useState(false);\n\n // Get the trigger and visible props for the toolbars\n const styleToolbarProps = useStyleToolbarProps(\n forwardedValue || defaultValue\n );\n const blockToolbarProps = useBlockToolbarProps(\n forwardedValue || defaultValue,\n (blockToolbarItems || []).length > 0\n );\n\n // Move the caret to the end of the content when the focus event was fired\n const setEditorState = useCallback(\n (editorState: EditorState) => {\n if (!editorState.getSelection().getHasFocus()) {\n setForwardedValue(EditorState.moveSelectionToEnd(editorState));\n return;\n }\n setForwardedValue(editorState);\n },\n [setForwardedValue]\n );\n\n const blockRenderer = useCallback(\n (block) => {\n const blockConfig = blockToolbarItems.find(\n (item) => item.type === block.getType()\n );\n if (!blockConfig) return null;\n return { component: blockConfig.component };\n },\n [blockToolbarItems]\n );\n\n // Custom handlers\n const returnHandler = useReturnHandler(setForwardedValue, handleReturn);\n const pastedTextHandler = usePastedTextHandler(\n setForwardedValue,\n handlePastedText\n );\n\n return (\n <>\n <Container\n disabled={disabled}\n size={size}\n tabIndex={!disabled ? 0 : -1}\n role={!disabled ? 'textbox' : undefined}\n onFocus={() => {\n if (disabled || !editorRef.current) return;\n editorRef.current.focus();\n }}\n >\n <DraftEditor\n onChange={setEditorState}\n blockRendererFn={blockRenderer}\n handleReturn={returnHandler}\n handlePastedText={pastedTextHandler}\n readOnly={readOnly || innerReadOnly || disabled}\n stripPastedStyles\n {...rest}\n editorState={forwardedValue || defaultValue}\n ref={mergedEditorRef}\n />\n </Container>\n\n <StyleToolbar\n {...styleToolbarProps}\n size={size}\n items={styleToolbarItems}\n value={forwardedValue || defaultValue}\n onChange={setForwardedValue}\n />\n\n <BlockToolbar\n {...blockToolbarProps}\n placement='right'\n gap={2.5}\n size={size}\n items={blockToolbarItems}\n value={forwardedValue || defaultValue}\n onChange={setForwardedValue}\n setReadOnly={setInnerReadOnly}\n />\n </>\n );\n }\n);\n\nEditor.displayName = 'Editor';\n\nexport default Editor;\n"],"mappings":";AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,cAAc,QAAQ,iBAAiB;AAEhD,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,kBAAkB;AACrE,SACEC,MAAM,IAAIC,WAAW,EAErBC,WAAW,QACN,UAAU;AACjB,OAAOC,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAChE,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,OAAOC,oBAAoB,MAAM,8BAA8B;AAC/D,OAAOC,oBAAoB,MAAM,8BAA8B;AAC/D,OAAOC,gBAAgB,MAAM,0BAA0B;AACvD,OAAOC,oBAAoB,MAAM,8BAA8B;AAC/D,OAAOC,oBAAoB,MAAM,+BAA+B;AAChE,OAAOC,qBAAqB,MAAM,gCAAgC;AAClE,OAAOC,sBAAsB,MAAM,gCAAgC;AACnE,OAAOC,wBAAwB,MAExB,kCAAkC;AAqCzC,MAAMC,cAAc,GAAIC,CAAC,IACvBA,CAAC,CAACC,QAAQ,IACVxB,GAAG;AACL;AACA,GAAG;AAEH,MAAMyB,SAAS,GAAGxB,MAAM,CAACC,cAAc,CAAC;AACxC;AACA;AACA;AACA,aAAcqB,CAAC,IAAKA,CAAC,CAACG,KAAK,CAACC,qBAAqB;AACjD,MAAOJ,CAAC,IAAKA,CAAC,CAACG,KAAK,CAACE,sBAAsB;AAC3C,gBAAiBL,CAAC,IAAKA,CAAC,CAACG,KAAK,CAACG,eAAe;AAC9C;AACA,IAAIX,oBAA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5CO,GAAG,EAAEE;EAAgB,EACtB,CACQ,CAAC,eAEZlC,KAAA,CAAAyD,aAAA,CAACpD,YAAY,EAAA4D,QAAA,KACP1B,iBAAiB;IACrBZ,IAAI,EAAEA,IAAK;IACXyC,KAAK,EAAE9C,iBAAkB;IACzBE,KAAK,EAAEW,cAAc,IAAIV,YAAa;IACtCC,QAAQ,EAAEU;EAAkB,EAC7B,CAAC,eAEFpC,KAAA,CAAAyD,aAAA,CAACrD,YAAY,EAAA6D,QAAA,KACPzB,iBAAiB;IACrB6B,SAAS,EAAC,OAAO;IACjBC,GAAG,EAAE,GAAI;IACT3C,IAAI,EAAEA,IAAK;IACXyC,KAAK,EAAE7C,iBAAkB;IACzBC,KAAK,EAAEW,cAAc,IAAIV,YAAa;IACtCC,QAAQ,EAAEU,iBAAkB;IAC5BmC,WAAW,EAAEjC;EAAiB,EAC/B,CACD,CAAC;AAEP,CACF,CAAC;AAEDzC,MAAM,CAAC2E,WAAW,GAAG,QAAQ;AAE7B,eAAe3E,MAAM","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultDraftJsStyles.js","names":["css","defaultDraftJsStyles"],"sources":["../../../../src/Editor/styles/defaultDraftJsStyles.ts"],"sourcesContent":["import { css } from '@emotion/react';\n\n/**\n * Default Draft.js styles.\n * The original styles located in `node_modules/draft-js/dist/Draft.css`.\n */\nconst defaultDraftJsStyles = css`\n .DraftEditor-editorContainer,\n .DraftEditor-root,\n .public-DraftEditor-content {\n height: inherit;\n text-align: initial;\n }\n .public-DraftEditor-content[contenteditable='true'] {\n -webkit-user-modify: read-write-plaintext-only;\n }\n .DraftEditor-root {\n position: relative;\n }\n .DraftEditor-editorContainer {\n background-color: rgba(255, 255, 255, 0);\n border-left: 0.1px solid transparent;\n position: relative;\n z-index: 1;\n }\n .public-DraftEditor-block {\n position: relative;\n }\n .DraftEditor-alignLeft .public-DraftStyleDefault-block {\n text-align: left;\n }\n .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root {\n left: 0;\n text-align: left;\n }\n .DraftEditor-alignCenter .public-DraftStyleDefault-block {\n text-align: center;\n }\n .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root {\n margin: 0 auto;\n text-align: center;\n width: 100%;\n }\n .DraftEditor-alignRight .public-DraftStyleDefault-block {\n text-align: right;\n }\n .DraftEditor-alignRight .public-DraftEditorPlaceholder-root {\n right: 0;\n text-align: right;\n }\n .public-DraftEditorPlaceholder-root {\n color: #9197a3;\n position: absolute;\n width: 100%;\n z-index: 1;\n }\n .public-DraftEditorPlaceholder-hasFocus {\n color: #bdc1c9;\n }\n .DraftEditorPlaceholder-hidden {\n display: none;\n }\n .public-DraftStyleDefault-block {\n position: relative;\n white-space: pre-wrap;\n }\n .public-DraftStyleDefault-ltr {\n direction: ltr;\n text-align: left;\n }\n .public-DraftStyleDefault-rtl {\n direction: rtl;\n text-align: right;\n }\n .public-DraftStyleDefault-listLTR {\n direction: ltr;\n }\n .public-DraftStyleDefault-listRTL {\n direction: rtl;\n }\n .public-DraftStyleDefault-ol,\n .public-DraftStyleDefault-ul {\n margin: 16px 0;\n padding: 0;\n }\n .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR {\n margin-left: 1.5em;\n }\n .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL {\n margin-right: 1.5em;\n }\n .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR {\n margin-left: 3em;\n }\n .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL {\n margin-right: 3em;\n }\n .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR {\n margin-left: 4.5em;\n }\n .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL {\n margin-right: 4.5em;\n }\n .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR {\n margin-left: 6em;\n }\n .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL {\n margin-right: 6em;\n }\n .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR {\n margin-left: 7.5em;\n }\n .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL {\n margin-right: 7.5em;\n }\n .public-DraftStyleDefault-unorderedListItem {\n list-style-type: square;\n position: relative;\n }\n .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0 {\n list-style-type: disc;\n }\n .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1 {\n list-style-type: circle;\n }\n .public-DraftStyleDefault-orderedListItem {\n list-style-type: none;\n position: relative;\n }\n .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before {\n left: -36px;\n position: absolute;\n text-align: right;\n width: 30px;\n }\n .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before {\n position: absolute;\n right: -36px;\n text-align: left;\n width: 30px;\n }\n .public-DraftStyleDefault-orderedListItem:before {\n content: counter(ol0) '. ';\n counter-increment: ol0;\n }\n .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before {\n content: counter(ol1, lower-alpha) '. ';\n counter-increment: ol1;\n }\n .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before {\n content: counter(ol2, lower-roman) '. ';\n counter-increment: ol2;\n }\n .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before {\n content: counter(ol3) '. ';\n counter-increment: ol3;\n }\n .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before {\n content: counter(ol4, lower-alpha) '. ';\n counter-increment: ol4;\n }\n .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset {\n counter-reset: ol0;\n }\n .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset {\n counter-reset: ol1;\n }\n .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset {\n counter-reset: ol2;\n }\n .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset {\n counter-reset: ol3;\n }\n .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset {\n counter-reset: ol4;\n }\n`;\n\nexport default defaultDraftJsStyles;\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;;AAEpC;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAGD,GAAG;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,eAAeC,oBAAoB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overrideDraftJsStyles.js","names":["css","clr","overrideDraftJsStyles","p","theme","lineHeight","colorText","inputColorPlaceholder","paragraphMarginBottom"],"sources":["../../../../src/Editor/styles/overrideDraftJsStyles.ts"],"sourcesContent":["import { css } from '@emotion/react';\nimport { clr } from '@os-design/theming';\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nconst overrideDraftJsStyles = (p) => css`\n .DraftEditor-root {\n width: 100%;\n overflow: hidden;\n line-height: ${p.theme.lineHeight};\n color: ${clr(p.theme.colorText)};\n }\n .public-DraftEditorPlaceholder-root {\n color: ${clr(p.theme.inputColorPlaceholder)};\n }\n .public-DraftStyleDefault-block {\n margin: 0 0 ${p.theme.paragraphMarginBottom}em;\n }\n`;\n\nexport default overrideDraftJsStyles;\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,GAAG,QAAQ,oBAAoB;;AAExC;AACA,MAAMC,qBAAqB,GAAIC,CAAC,IAAKH,GAAG;AACxC;AACA;AACA;AACA,mBAAmBG,CAAC,CAACC,KAAK,CAACC,UAAU;AACrC,aAAaJ,GAAG,CAACE,CAAC,CAACC,KAAK,CAACE,SAAS,CAAC;AACnC;AACA;AACA,aAAaL,GAAG,CAACE,CAAC,CAACC,KAAK,CAACG,qBAAqB,CAAC;AAC/C;AACA;AACA,kBAAkBJ,CAAC,CAACC,KAAK,CAACI,qBAAqB;AAC/C;AACA,CAAC;AAED,eAAeN,qBAAqB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addNewBlockAt.js","names":["ContentBlock","EditorState","genKey","Immutable","addNewBlockAt","editorState","pivotBlockKey","type","data","contentState","getCurrentContent","blockMap","getBlockMap","pivotBlock","get","Error","blocksBefore","toSeq","takeUntil","v","blocksAfter","skipUntil","rest","key","block","text","characterList","List","depth","Map","selectionState","getSelection","nextBlockMap","concat","toOrderedMap","nextContentState","merge","selectionBefore","selectionAfter","anchorKey","anchorOffset","focusKey","focusOffset","isBackward","push"],"sources":["../../../../src/Editor/utils/addNewBlockAt.ts"],"sourcesContent":["import { ContentBlock, ContentState, EditorState, genKey } from 'draft-js';\nimport Immutable from 'immutable';\n\nconst addNewBlockAt = (\n editorState: EditorState,\n pivotBlockKey: string,\n type = 'unstyled',\n data: Record<string, any> = {} // eslint-disable-line @typescript-eslint/no-explicit-any\n): EditorState => {\n const contentState = editorState.getCurrentContent();\n const blockMap = contentState.getBlockMap();\n const pivotBlock = blockMap.get(pivotBlockKey);\n if (!pivotBlock)\n throw new Error(\n `The pivot key - ${pivotBlockKey} is not present in blockMap`\n );\n const blocksBefore = blockMap.toSeq().takeUntil((v) => v === pivotBlock);\n const blocksAfter = blockMap\n .toSeq()\n .skipUntil((v) => v === pivotBlock)\n .rest();\n const key = genKey();\n\n const block = new ContentBlock({\n key,\n type,\n text: '',\n characterList: Immutable.List(),\n depth: 0,\n data: Immutable.Map(data),\n });\n\n const selectionState = editorState.getSelection();\n const nextBlockMap = blocksBefore\n .concat(\n [\n [pivotBlockKey, pivotBlock],\n [key, block],\n ],\n blocksAfter\n )\n .toOrderedMap();\n\n const nextContentState = contentState.merge({\n blockMap: nextBlockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState.merge({\n anchorKey: key,\n anchorOffset: 0,\n focusKey: key,\n focusOffset: 0,\n isBackward: false,\n }),\n }) as ContentState;\n\n return EditorState.push(editorState, nextContentState, 'split-block');\n};\n\nexport default addNewBlockAt;\n"],"mappings":"AAAA,SAASA,YAAY,EAAgBC,WAAW,EAAEC,MAAM,QAAQ,UAAU;AAC1E,OAAOC,SAAS,MAAM,WAAW;AAEjC,MAAMC,aAAa,GAAGA,CACpBC,WAAwB,EACxBC,aAAqB,EACrBC,IAAI,GAAG,UAAU,EACjBC,IAAyB,GAAG,CAAC,CAAC,CAAC;AAAA,KACf;EAChB,MAAMC,YAAY,GAAGJ,WAAW,CAACK,iBAAiB,CAAC,CAAC;EACpD,MAAMC,QAAQ,GAAGF,YAAY,CAACG,WAAW,CAAC,CAAC;EAC3C,MAAMC,UAAU,GAAGF,QAAQ,CAACG,GAAG,CAACR,aAAa,CAAC;EAC9C,IAAI,CAACO,UAAU,EACb,MAAM,IAAIE,KAAK,CACb,mBAAmBT,aAAa,6BAClC,CAAC;EACH,MAAMU,YAAY,GA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@
|
|
|
1
|
-
{"version":3,"file":"changeBlock.js","names":["EditorState","changeBlock","editorState","block","type","data","contentState","getCurrentContent","nextCurrentBlock","merge","nextContentState","blockMap","getBlockMap","set","getKey","selectionAfter","getSelection","push"],"sources":["../../../../src/Editor/utils/changeBlock.ts"],"sourcesContent":["import { ContentBlock, ContentState, EditorState } from 'draft-js';\n\nconst changeBlock = (\n editorState: EditorState,\n block: ContentBlock,\n type: string,\n data: Record<string, any> = {} // eslint-disable-line @typescript-eslint/no-explicit-any\n): EditorState => {\n const contentState = editorState.getCurrentContent();\n\n const nextCurrentBlock = block.merge({ type, data }) as ContentBlock;\n const nextContentState = contentState.merge({\n blockMap: contentState.getBlockMap().set(block.getKey(), nextCurrentBlock),\n selectionAfter: editorState.getSelection(),\n }) as ContentState;\n\n return EditorState.push(editorState, nextContentState, 'change-block-type');\n};\n\nexport default changeBlock;\n"],"mappings":"AAAA,SAAqCA,WAAW,QAAQ,UAAU;AAElE,MAAMC,WAAW,GAAGA,CAClBC,WAAwB,EACxBC,KAAmB,EACnBC,IAAY,EACZC,IAAyB,GAAG,CAAC,CAAC,CAAC;AAAA,KACf;EAChB,MAAMC,YAAY,GAAGJ,WAAW,CAACK,iBAAiB,CAAC,CAAC;EAEpD,MAAMC,gBAAgB,GAAGL,KAAK,CAACM,KAAK,CAAC;IAAEL,IAAI;IAAEC;EAAK,CAAC,CAAiB;EACpE,MAAMK,gBAAgB,GAAGJ,YAAY,CAACG,KAAK,CAAC;IAC1CE,QAAQ,EAAEL,YAAY,CAACM,WAAW,CAAC,CAAC,CAACC,GAAG,CAACV,KAAK,CAACW,MAAM,CAAC,CAAC,EAAEN,gBAAgB,CAAC;IAC1EO,cAAc,EAAEb,WAAW,CAACc,YAAY,CAAC;EAC3C,CAAC,CAAiB;EAElB,OAAOhB,WAAW,CAACiB,IAAI,CAACf,WAAW,EAAEQ,gBAAgB,EAAE,mBAAmB,CAAC;AAC7E,CAAC;AAED,eAAeT,WAAW","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createContentEditorState.js","names":["EditorState","createDecorator","createContentEditorState","contentState","createWithContent"],"sources":["../../../../src/Editor/utils/createContentEditorState.ts"],"sourcesContent":["import { ContentState, EditorState } from 'draft-js';\nimport createDecorator from './createDecorator';\n\nconst createContentEditorState = (contentState: ContentState): EditorState =>\n EditorState.createWithContent(contentState, createDecorator());\n\nexport default createContentEditorState;\n"],"mappings":"AAAA,SAAuBA,WAAW,QAAQ,UAAU;AACpD,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,MAAMC,wBAAwB,GAAIC,YAA0B,IAC1DH,WAAW,CAACI,iBAAiB,CAACD,YAAY,EAAEF,eAAe,CAAC,CAAC,CAAC;AAEhE,eAAeC,wBAAwB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDecorator.js","names":["CompositeDecorator","linkDecorator","createDecorator"],"sources":["../../../../src/Editor/utils/createDecorator.ts"],"sourcesContent":["import { CompositeDecorator } from 'draft-js';\nimport linkDecorator from '../decorators/linkDecorator';\n\nconst createDecorator = (): CompositeDecorator =>\n new CompositeDecorator([linkDecorator]);\n\nexport default createDecorator;\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,UAAU;AAC7C,OAAOC,aAAa,MAAM,6BAA6B;AAEvD,MAAMC,eAAe,GAAGA,CAAA,KACtB,IAAIF,kBAAkB,CAAC,CAACC,aAAa,CAAC,CAAC;AAEzC,eAAeC,eAAe","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createEmptyEditorState.js","names":["EditorState","createDecorator","createEmptyEditorState","createEmpty"],"sources":["../../../../src/Editor/utils/createEmptyEditorState.ts"],"sourcesContent":["import { EditorState } from 'draft-js';\nimport createDecorator from './createDecorator';\n\nconst createEmptyEditorState = (): EditorState =>\n EditorState.createEmpty(createDecorator());\n\nexport default createEmptyEditorState;\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,UAAU;AACtC,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,MAAMC,sBAAsB,GAAGA,CAAA,KAC7BF,WAAW,CAACG,WAAW,CAACF,eAAe,CAAC,CAAC,CAAC;AAE5C,eAAeC,sBAAsB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultStyleToolbarItems.js","names":["styled","Bold","FontSize","Link","LinkIcon","OrderedList","UnorderedList","React","FontSizeSmall","defaultStyleToolbarItems","name","type","icon","createElement"],"sources":["../../../../src/Editor/utils/defaultStyleToolbarItems.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport {\n Bold,\n FontSize,\n Link as LinkIcon,\n OrderedList,\n UnorderedList,\n} from '@os-design/icons';\nimport React from 'react';\n\nexport interface StyleToolbarItem {\n name: string;\n type: 'block' | 'inline';\n icon: React.ReactNode;\n}\n\nconst FontSizeSmall = styled(FontSize)`\n transform: scale(0.7);\n`;\n\nconst defaultStyleToolbarItems: StyleToolbarItem[] = [\n { name: 'header-two', type: 'block', icon: <FontSize /> },\n { name: 'header-three', type: 'block', icon: <FontSizeSmall /> },\n { name: 'BOLD', type: 'inline', icon: <Bold /> },\n { name: 'unordered-list-item', type: 'block', icon: <UnorderedList /> },\n { name: 'ordered-list-item', type: 'block', icon: <OrderedList /> },\n { name: 'LINK', type: 'inline', icon: <LinkIcon /> },\n];\n\nexport default defaultStyleToolbarItems;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SACEC,IAAI,EACJC,QAAQ,EACRC,IAAI,IAAIC,QAAQ,EAChBC,WAAW,EACXC,aAAa,QACR,kBAAkB;AACzB,OAAOC,KAAK,MAAM,OAAO;AAQzB,MAAMC,aAAa,GAAGR,MAAM,CAACE,QAAQ,CAAC;AACtC;AACA,CAAC;AAED,MAAMO,wBAA4C,GAAG,CACnD;EAAEC,IAAI,EAAE,YAAY;EAAEC,IAAI,EAAE,OAAO;EAAEC,IAAI,eAAEL,KAAA,CAAAM,aAAA,CAACX,QAAQ,MAAE;AAAE,CAAC,EACzD;EAAEQ,IAAI,EAAE,cAAc;EAAEC,IAAI,EAAE,OAAO;EAAEC,IAAI,eAAEL,KAAA,CAAAM,aAAA,CAACL,aAAa,MAAE;AAAE,CAAC,EAChE;EAAEE,IAAI,EAAE,MAAM;EAAEC,IAAI,EAAE,QAAQ;EAAEC,IAAI,eAAEL,KAAA,CAAAM,aAAA,CAACZ,IAAI,MAAE;AAAE,CAAC,EAChD;EAAES,IAAI,EAAE,qBAAqB;EAAEC,IAAI,EAAE,OAAO;EAAEC,IAAI,eAAEL,KAAA,CAAAM,aAAA,CAACP,aAAa,MAAE;AAAE,CAAC,EACvE;EAAEI,IAAI,EAAE,mBAAmB;EAAEC,IAAI,EAAE,OAAO;EAAEC,IAAI,eAAEL,KAAA,CAAAM,aAAA,CAACR,WAAW,MAAE;AAAE,CAAC,EACnE;EAAEK,IAAI,EAAE,MAAM;EAAEC,IAAI,EAAE,QAAQ;EAAEC,IAAI,eAAEL,KAAA,CAAAM,aAAA,CAACT,QAAQ,MAAE;AAAE,CAAC,CACrD;AAED,eAAeK,wBAAwB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCurrentBlock.js","names":["getCurrentBlock","editorState","selectionState","getSelection","contentState","getCurrentContent","getBlockForKey","getStartKey"],"sources":["../../../../src/Editor/utils/getCurrentBlock.ts"],"sourcesContent":["import { ContentBlock, EditorState } from 'draft-js';\n\nconst getCurrentBlock = (editorState: EditorState): ContentBlock => {\n const selectionState = editorState.getSelection();\n const contentState = editorState.getCurrentContent();\n return contentState.getBlockForKey(selectionState.getStartKey());\n};\n\nexport default getCurrentBlock;\n"],"mappings":"AAEA,MAAMA,eAAe,GAAIC,WAAwB,IAAmB;EAClE,MAAMC,cAAc,GAAGD,WAAW,CAACE,YAAY,CAAC,CAAC;EACjD,MAAMC,YAAY,GAAGH,WAAW,CAACI,iBAAiB,CAAC,CAAC;EACpD,OAAOD,YAAY,CAACE,cAAc,CAACJ,cAAc,CAACK,WAAW,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,eAAeP,eAAe","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSelectedBlockElement.js","names":["getSelectionRange","getSelectedBlockElement","selectionRange","node","startContainer","Element","getAttribute","parentNode"],"sources":["../../../../src/Editor/utils/getSelectedBlockElement.ts"],"sourcesContent":["import getSelectionRange from './getSelectionRange';\n\nconst getSelectedBlockElement = (): Element | null => {\n const selectionRange = getSelectionRange();\n if (!selectionRange) return null;\n\n let node: Node | null = selectionRange.startContainer;\n\n do {\n if (node instanceof Element && node.getAttribute('data-block') === 'true')\n return node;\n node = node.parentNode;\n } while (node != null);\n return null;\n};\n\nexport default getSelectedBlockElement;\n"],"mappings":"AAAA,OAAOA,iBAAiB,MAAM,qBAAqB;AAEnD,MAAMC,uBAAuB,GAAGA,CAAA,KAAsB;EACpD,MAAMC,cAAc,GAAGF,iBAAiB,CAAC,CAAC;EAC1C,IAAI,CAACE,cAAc,EAAE,OAAO,IAAI;EAEhC,IAAIC,IAAiB,GAAGD,cAAc,CAACE,cAAc;EAErD,GAAG;IACD,IAAID,IAAI,YAAYE,OAAO,IAAIF,IAAI,CAACG,YAAY,CAAC,YAAY,CAAC,KAAK,MAAM,EACvE,OAAOH,IAAI;IACbA,IAAI,GAAGA,IAAI,CAACI,UAAU;EACxB,CAAC,QAAQJ,IAAI,IAAI,IAAI;EACrB,OAAO,IAAI;AACb,CAAC;AAED,eAAeF,uBAAuB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSelectionRange.js","names":["getSelectionRange","selection","document","getSelection","rangeCount","getRangeAt"],"sources":["../../../../src/Editor/utils/getSelectionRange.ts"],"sourcesContent":["const getSelectionRange = (): Range | null => {\n const selection = document.getSelection();\n if (!selection || selection.rangeCount === 0) return null;\n return selection.getRangeAt(0);\n};\n\nexport default getSelectionRange;\n"],"mappings":"AAAA,MAAMA,iBAAiB,GAAGA,CAAA,KAAoB;EAC5C,MAAMC,SAAS,GAAGC,QAAQ,CAACC,YAAY,CAAC,CAAC;EACzC,IAAI,CAACF,SAAS,IAAIA,SAAS,CAACG,UAAU,KAAK,CAAC,EAAE,OAAO,IAAI;EACzD,OAAOH,SAAS,CAACI,UAAU,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,eAAeL,iBAAiB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setLink.js","names":["EditorState","RichUtils","setLink","editorState","url","containsLink","currentBlockContainsLink","contentState","getCurrentContent","contentStateWithLink","createEntity","entityKey","getLastCreatedEntityKey","nextEditorState","set","currentContent","toggleLink","getSelection"],"sources":["../../../../src/Editor/utils/setLink.ts"],"sourcesContent":["import { EditorState, RichUtils } from 'draft-js';\n\nconst setLink = (editorState: EditorState, url: string): EditorState => {\n const containsLink = RichUtils.currentBlockContainsLink(editorState);\n if (containsLink) return editorState;\n\n const contentState = editorState.getCurrentContent();\n const contentStateWithLink = contentState.createEntity('LINK', 'MUTABLE', {\n url,\n });\n const entityKey = contentStateWithLink.getLastCreatedEntityKey();\n const nextEditorState = EditorState.set(editorState, {\n currentContent: contentStateWithLink,\n });\n return RichUtils.toggleLink(\n nextEditorState,\n nextEditorState.getSelection(),\n entityKey\n );\n};\n\nexport default setLink;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,QAAQ,UAAU;AAEjD,MAAMC,OAAO,GAAGA,CAACC,WAAwB,EAAEC,GAAW,KAAkB;EACtE,MAAMC,YAAY,GAAGJ,SAAS,CAACK,wBAAwB,CAACH,WAAW,CAAC;EACpE,IAAIE,YAAY,EAAE,OAAOF,WAAW;EAEpC,MAAMI,YAAY,GAAGJ,WAAW,CAACK,iBAAiB,CAAC,CAAC;EACpD,MAAMC,oBAAoB,GAAGF,YAAY,CAACG,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE;IACxEN;EACF,CAAC,CAAC;EACF,MAAMO,SAAS,GAAGF,oBAAoB,CAACG,uBAAuB,CAAC,CAAC;EAChE,MAAMC,eAAe,GAAGb,WAAW,CAACc,GAAG,CAACX,WAAW,EAAE;IACnDY,cAAc,EAAEN;EAClB,CAAC,CAAC;EACF,OAAOR,SAAS,CAACe,UAAU,CACzBH,eAAe,EACfA,eAAe,CAACI,YAAY,CAAC,CAAC,EAC9BN,SACF,CAAC;AACH,CAAC;AAED,eAAeT,OAAO","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.js","names":["editorStateToFirstParagraph","editorState","firstUnstyledBlock","getCurrentContent","getBlocksAsArray","find","block","getType","getText","editorStateToMetaDescription","slice","replace","trim"],"sources":["../../../../src/Editor/utils/transformers.ts"],"sourcesContent":["import { EditorState } from 'draft-js';\n\nexport const editorStateToFirstParagraph = (\n editorState: EditorState\n): string => {\n const firstUnstyledBlock = editorState\n .getCurrentContent()\n .getBlocksAsArray()\n .find((block) => block.getType() === 'unstyled');\n\n return firstUnstyledBlock ? firstUnstyledBlock.getText() : '';\n};\n\nexport const editorStateToMetaDescription = (\n editorState: EditorState\n): string =>\n editorStateToFirstParagraph(editorState)\n .slice(0, 200)\n .replace(/^(.*[.?!])(.*)/, '$1')\n .trim();\n"],"mappings":"AAEA,OAAO,MAAMA,2BAA2B,GACtCC,WAAwB,IACb;EACX,MAAMC,kBAAkB,GAAGD,WAAW,CACnCE,iBAAiB,CAAC,CAAC,CACnBC,gBAAgB,CAAC,CAAC,CAClBC,IAAI,CAAEC,KAAK,IAAKA,KAAK,CAACC,OAAO,CAAC,CAAC,KAAK,UAAU,CAAC;EAElD,OAAOL,kBAAkB,GAAGA,kBAAkB,CAACM,OAAO,CAAC,CAAC,GAAG,EAAE;AAC/D,CAAC;AAED,OAAO,MAAMC,4BAA4B,GACvCR,WAAwB,IAExBD,2BAA2B,CAACC,WAAW,CAAC,CACrCS,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CACbC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAC/BC,IAAI,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unsetLink.js","names":["RichUtils","unsetLink","editorState","containsLink","currentBlockContainsLink","selectionState","getSelection","toggleLink"],"sources":["../../../../src/Editor/utils/unsetLink.ts"],"sourcesContent":["import { EditorState, RichUtils } from 'draft-js';\n\nconst unsetLink = (editorState: EditorState): EditorState => {\n const containsLink = RichUtils.currentBlockContainsLink(editorState);\n if (!containsLink) return editorState;\n\n const selectionState = editorState.getSelection();\n return RichUtils.toggleLink(editorState, selectionState, null);\n};\n\nexport default unsetLink;\n"],"mappings":"AAAA,SAAsBA,SAAS,QAAQ,UAAU;AAEjD,MAAMC,SAAS,GAAIC,WAAwB,IAAkB;EAC3D,MAAMC,YAAY,GAAGH,SAAS,CAACI,wBAAwB,CAACF,WAAW,CAAC;EACpE,IAAI,CAACC,YAAY,EAAE,OAAOD,WAAW;EAErC,MAAMG,cAAc,GAAGH,WAAW,CAACI,YAAY,CAAC,CAAC;EACjD,OAAON,SAAS,CAACO,UAAU,CAACL,WAAW,EAAEG,cAAc,EAAE,IAAI,CAAC;AAChE,CAAC;AAED,eAAeJ,SAAS","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import styled from '@emotion/styled';
|
|
3
|
-
import { InputSkeleton } from '@os-design/core';
|
|
4
|
-
import React, { forwardRef } from 'react';
|
|
5
|
-
const StyledEditorSkeleton = styled(InputSkeleton)`
|
|
6
|
-
height: ${p => p.theme.editorMinHeight}em;
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Provides an editor placeholder while a user waits for the content to load.
|
|
11
|
-
*/
|
|
12
|
-
const EditorSkeleton = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React.createElement(StyledEditorSkeleton, _extends({}, props, {
|
|
13
|
-
ref: ref
|
|
14
|
-
})));
|
|
15
|
-
EditorSkeleton.displayName = 'EditorSkeleton';
|
|
16
|
-
export default EditorSkeleton;
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["styled","InputSkeleton","React","forwardRef","StyledEditorSkeleton","p","theme","editorMinHeight","EditorSkeleton","props","ref","createElement","_extends","displayName"],"sources":["../../../src/EditorSkeleton/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { InputSkeleton, InputSkeletonProps } from '@os-design/core';\nimport React, { forwardRef } from 'react';\n\nexport type EditorSkeletonProps = InputSkeletonProps;\n\nconst StyledEditorSkeleton = styled(InputSkeleton)`\n height: ${(p) => p.theme.editorMinHeight}em;\n`;\n\n/**\n * Provides an editor placeholder while a user waits for the content to load.\n */\nconst EditorSkeleton = forwardRef<HTMLDivElement, EditorSkeletonProps>(\n (props, ref) => <StyledEditorSkeleton {...props} ref={ref} />\n);\n\nEditorSkeleton.displayName = 'EditorSkeleton';\n\nexport default EditorSkeleton;\n"],"mappings":";AAAA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAASC,aAAa,QAA4B,iBAAiB;AACnE,OAAOC,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAIzC,MAAMC,oBAAoB,GAAGJ,MAAM,CAACC,aAAa,CAAC;AAClD,YAAaI,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACC,eAAe;AAC1C,CAAC;;AAED;AACA;AACA;AACA,MAAMC,cAAc,gBAAGL,UAAU,CAC/B,CAACM,KAAK,EAAEC,GAAG,kBAAKR,KAAA,CAAAS,aAAA,CAACP,oBAAoB,EAAAQ,QAAA,KAAKH,KAAK;EAAEC,GAAG,EAAEA;AAAI,EAAE,CAC9D,CAAC;AAEDF,cAAc,CAACK,WAAW,GAAG,gBAAgB;AAE7C,eAAeL,cAAc","ignoreList":[]}
|
package/dist/esm/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export { default as Editor } from './Editor';
|
|
2
|
-
export { default as addNewBlockAt } from './Editor/utils/addNewBlockAt';
|
|
3
|
-
export { default as changeBlock } from './Editor/utils/changeBlock';
|
|
4
|
-
export { default as createContentEditorState } from './Editor/utils/createContentEditorState';
|
|
5
|
-
export { default as createDecorator } from './Editor/utils/createDecorator';
|
|
6
|
-
export { default as createEmptyEditorState } from './Editor/utils/createEmptyEditorState';
|
|
7
|
-
export { default as defaultStyleToolbarItems } from './Editor/utils/defaultStyleToolbarItems';
|
|
8
|
-
export { default as getCurrentBlock } from './Editor/utils/getCurrentBlock';
|
|
9
|
-
export { default as imageBlock } from './Editor/blocks/imageBlock';
|
|
10
|
-
export { default as videoBlock } from './Editor/blocks/videoBlock';
|
|
11
|
-
export { default as EditorSkeleton } from './EditorSkeleton';
|
|
12
|
-
export * from './Editor';
|
|
13
|
-
export * from './Editor/utils/transformers';
|
|
14
|
-
export * from './Editor/blocks/types';
|
|
15
|
-
export * from './EditorSkeleton';
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","Editor","addNewBlockAt","changeBlock","createContentEditorState","createDecorator","createEmptyEditorState","defaultStyleToolbarItems","getCurrentBlock","imageBlock","videoBlock","EditorSkeleton"],"sources":["../../src/index.ts"],"sourcesContent":["export { default as Editor } from './Editor';\nexport { default as addNewBlockAt } from './Editor/utils/addNewBlockAt';\nexport { default as changeBlock } from './Editor/utils/changeBlock';\nexport { default as createContentEditorState } from './Editor/utils/createContentEditorState';\nexport { default as createDecorator } from './Editor/utils/createDecorator';\nexport { default as createEmptyEditorState } from './Editor/utils/createEmptyEditorState';\nexport { default as defaultStyleToolbarItems } from './Editor/utils/defaultStyleToolbarItems';\nexport { default as getCurrentBlock } from './Editor/utils/getCurrentBlock';\nexport { default as imageBlock } from './Editor/blocks/imageBlock';\nexport { default as videoBlock } from './Editor/blocks/videoBlock';\nexport { default as EditorSkeleton } from './EditorSkeleton';\n\nexport * from './Editor';\nexport * from './Editor/utils/transformers';\nexport * from './Editor/blocks/types';\nexport * from './EditorSkeleton';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,MAAM,QAAQ,UAAU;AAC5C,SAASD,OAAO,IAAIE,aAAa,QAAQ,8BAA8B;AACvE,SAASF,OAAO,IAAIG,WAAW,QAAQ,4BAA4B;AACnE,SAASH,OAAO,IAAII,wBAAwB,QAAQ,yCAAyC;AAC7F,SAASJ,OAAO,IAAIK,eAAe,QAAQ,gCAAgC;AAC3E,SAASL,OAAO,IAAIM,sBAAsB,QAAQ,uCAAuC;AACzF,SAASN,OAAO,IAAIO,wBAAwB,QAAQ,yCAAyC;AAC7F,SAASP,OAAO,IAAIQ,eAAe,QAAQ,gCAAgC;AAC3E,SAASR,OAAO,IAAIS,UAAU,QAAQ,4BAA4B;AAClE,SAAST,OAAO,IAAIU,UAAU,QAAQ,4BAA4B;AAClE,SAASV,OAAO,IAAIW,cAAc,QAAQ,kBAAkB;AAE5D,cAAc,UAAU;AACxB,cAAc,6BAA6B;AAC3C,cAAc,uBAAuB;AACrC,cAAc,kBAAkB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BlockToolbar.d.ts","sourceRoot":"","sources":["../../../src/Editor/BlockToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,UAAU,iBAAkB,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC;IAChE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8B7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StyleToolbar.d.ts","sourceRoot":"","sources":["../../../src/Editor/StyleToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAa,MAAM,UAAU,CAAC;AAClD,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIpE,UAAU,iBAAkB,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC;IAChE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CACxC;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0D7C,CAAC;AAIF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/Editor/Toolbar.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,OAAO;;UASZ,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarButton.d.ts","sourceRoot":"","sources":["../../../src/Editor/ToolbarButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,cAAc,GAAG,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACtD,UAAU,kBAAmB,SAAQ,cAAc;IACjD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAqCD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAW/C,CAAC;AAIF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Figure.d.ts","sourceRoot":"","sources":["../../../../src/Editor/blocks/Figure.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM;;SAQqV,MAAO,WAAW;mGALlX,CAAC;AAIF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FigureCaption.d.ts","sourceRoot":"","sources":["../../../../src/Editor/blocks/FigureCaption.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,aAAa;;SAgBiD,MAAO,WAAW;mGALrF,CAAC;AAIF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imageBlock.d.ts","sourceRoot":"","sources":["../../../../src/Editor/blocks/imageBlock.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAc,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA2FvD,eAAO,MAAM,WAAW,iBAAiB,CAAC;AAE1C,QAAA,MAAM,UAAU,kBACC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,KAC7C,gBAgDD,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/Editor/blocks/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACrD,KAAK,EAAE,YAAY,CAAC;CACrB;AAGD,MAAM,WAAW,4BAA6B,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACvE,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;IAChC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,IAAI,CAAC;CACxD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"videoBlock.d.ts","sourceRoot":"","sources":["../../../../src/Editor/blocks/videoBlock.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAc,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAkDvD,eAAO,MAAM,WAAW,iBAAiB,CAAC;AAE1C,QAAA,MAAM,UAAU,EAAE,gBAmBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linkDecorator.d.ts","sourceRoot":"","sources":["../../../../src/Editor/decorators/linkDecorator.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,QAAA,MAAM,aAAa,EAAE,cAcpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBlockToolbarProps.d.ts","sourceRoot":"","sources":["../../../../src/Editor/hooks/useBlockToolbarProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,UAAU,IAAI;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,uBAAuB;IAC/B,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAKD,QAAA,MAAM,oBAAoB,UACjB,WAAW,QACZ,OAAO,KACZ,uBA+CF,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePastedTextHandler.d.ts","sourceRoot":"","sources":["../../../../src/Editor/hooks/usePastedTextHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,gBAAgB,EAE/B,WAAW,EAGZ,MAAM,UAAU,CAAC;AAGlB,KAAK,uBAAuB,GAAG,OAAO,CACpC,gBAAgB,CAAC,kBAAkB,CAAC,EACpC,SAAS,CACV,CAAC;AAKF,QAAA,MAAM,oBAAoB,aACd,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,WAC7B,uBAAuB,KAC/B,uBAwBA,CAAC;AAEJ,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useReturnHandler.d.ts","sourceRoot":"","sources":["../../../../src/Editor/hooks/useReturnHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAKxE,KAAK,mBAAmB,GAAG,WAAW,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC;AAKzE,QAAA,MAAM,gBAAgB,aACV,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,WAC7B,mBAAmB,KAC3B,mBAqBA,CAAC;AAEJ,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useStyleToolbarProps.d.ts","sourceRoot":"","sources":["../../../../src/Editor/hooks/useStyleToolbarProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,UAAU,CAAC;AAIlD,UAAU,IAAI;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,uBAAuB;IAC/B,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAKD,QAAA,MAAM,oBAAoB,UAAW,WAAW,KAAG,uBA+BlD,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { WithSize } from '@os-design/styles';
|
|
2
|
-
import { Editor as DraftEditor, EditorProps as DraftEditorProps, EditorState } from 'draft-js';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { BlockToolbarItem } from './blocks/types';
|
|
5
|
-
import { StyleToolbarItem } from './utils/defaultStyleToolbarItems';
|
|
6
|
-
export interface EditorProps extends Omit<DraftEditorProps, 'editorState' | 'onChange'>, WithSize {
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
styleToolbarItems?: StyleToolbarItem[];
|
|
9
|
-
blockToolbarItems?: BlockToolbarItem[];
|
|
10
|
-
value?: EditorState;
|
|
11
|
-
defaultValue?: EditorState;
|
|
12
|
-
onChange?: (value: EditorState) => void;
|
|
13
|
-
}
|
|
14
|
-
declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<DraftEditor>>;
|
|
15
|
-
export default Editor;
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Editor/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EACL,MAAM,IAAI,WAAW,EACrB,WAAW,IAAI,gBAAgB,EAC/B,WAAW,EACZ,MAAM,UAAU,CAAC;AAClB,OAAO,KAA4C,MAAM,OAAO,CAAC;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQlD,OAAiC,EAC/B,gBAAgB,EACjB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,aAAa,GAAG,UAAU,CAAC,EACxD,QAAQ;IAKV,QAAQ,CAAC,EAAE,OAAO,CAAC;IAKnB,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAKvC,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAKvC,KAAK,CAAC,EAAE,WAAW,CAAC;IAKpB,YAAY,CAAC,EAAE,WAAW,CAAC;IAK3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CACzC;AAwBD,QAAA,MAAM,MAAM,iFAiHX,CAAC;AAIF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultDraftJsStyles.d.ts","sourceRoot":"","sources":["../../../../src/Editor/styles/defaultDraftJsStyles.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,oBAAoB,2CA0KzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overrideDraftJsStyles.d.ts","sourceRoot":"","sources":["../../../../src/Editor/styles/overrideDraftJsStyles.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,qBAAqB,uDAa1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addNewBlockAt.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/addNewBlockAt.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,WAAW,EAAU,MAAM,UAAU,CAAC;AAG3E,QAAA,MAAM,aAAa,gBACJ,WAAW,iBACT,MAAM,wBAEf,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACxB,WAgDF,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changeBlock.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/changeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,WAAW,EAAE,MAAM,UAAU,CAAC;AAEnE,QAAA,MAAM,WAAW,gBACF,WAAW,SACjB,YAAY,QACb,MAAM,SACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACxB,WAUF,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createContentEditorState.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/createContentEditorState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGrD,QAAA,MAAM,wBAAwB,iBAAkB,YAAY,KAAG,WACC,CAAC;AAEjE,eAAe,wBAAwB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDecorator.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/createDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,QAAA,MAAM,eAAe,QAAO,kBACa,CAAC;AAE1C,eAAe,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createEmptyEditorState.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/createEmptyEditorState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,QAAA,MAAM,sBAAsB,QAAO,WACS,CAAC;AAE7C,eAAe,sBAAsB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultStyleToolbarItems.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/defaultStyleToolbarItems.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB;AAMD,QAAA,MAAM,wBAAwB,EAAE,gBAAgB,EAO/C,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCurrentBlock.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/getCurrentBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAErD,QAAA,MAAM,eAAe,gBAAiB,WAAW,KAAG,YAInD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSelectedBlockElement.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/getSelectedBlockElement.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,uBAAuB,QAAO,OAAO,GAAG,IAY7C,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSelectionRange.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/getSelectionRange.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB,QAAO,KAAK,GAAG,IAIrC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setLink.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/setLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,UAAU,CAAC;AAElD,QAAA,MAAM,OAAO,gBAAiB,WAAW,OAAO,MAAM,KAAG,WAiBxD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/transformers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,2BAA2B,gBACzB,WAAW,KACvB,MAOF,CAAC;AAEF,eAAO,MAAM,4BAA4B,gBAC1B,WAAW,KACvB,MAIQ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unsetLink.d.ts","sourceRoot":"","sources":["../../../../src/Editor/utils/unsetLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,UAAU,CAAC;AAElD,QAAA,MAAM,SAAS,gBAAiB,WAAW,KAAG,WAM7C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { InputSkeletonProps } from '@os-design/core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export type EditorSkeletonProps = InputSkeletonProps;
|
|
4
|
-
declare const EditorSkeleton: React.ForwardRefExoticComponent<Omit<import("@os-design/core").SkeletonProps, "width"> & import("@os-design/styles").WithSize & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
export default EditorSkeleton;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/EditorSkeleton/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AASrD,QAAA,MAAM,cAAc,sKAEnB,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAC9F,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAC9F,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE7D,cAAc,UAAU,CAAC;AACzB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|