@yoopta/blockquote 4.7.0 → 4.7.1-rc.1

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.
@@ -0,0 +1,18 @@
1
+ import { YooEditor, YooptaBlockPath } from '@yoopta/editor';
2
+ import { BlockquoteElement } from '../types';
3
+ type BlockquoteElementOptions = {
4
+ text?: string;
5
+ };
6
+ export type InsertBlockquoteOptions = {
7
+ text?: string;
8
+ at?: YooptaBlockPath;
9
+ focus?: boolean;
10
+ };
11
+ export type BlockquoteCommands = {
12
+ buildBlockquoteElements: (editor: YooEditor, options?: Partial<BlockquoteElementOptions>) => BlockquoteElement;
13
+ insertBlockquote: (editor: YooEditor, options?: Partial<InsertBlockquoteOptions>) => void;
14
+ deleteBlockquote: (editor: YooEditor, blockId: string) => void;
15
+ };
16
+ export declare const BlockquoteCommands: BlockquoteCommands;
17
+ export {};
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,wBAAwB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uBAAuB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,KAAK,iBAAiB,CAAC;IAC/G,gBAAgB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,KAAK,IAAI,CAAC;IAC1F,gBAAgB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAChE,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,kBAahC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ declare module 'slate' {
6
6
  Element: BlockquoteElement;
7
7
  }
8
8
  }
9
+ export { BlockquoteCommands } from './commands';
9
10
  export default Blockquote;
10
11
  export { BlockquoteElement };
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EAAE,iBAAiB,CAAC;KAC5B;CACF;AAED,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EAAE,iBAAiB,CAAC;KAC5B;CACF;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{YooptaPlugin as e}from"@yoopta/editor";import{jsx as t}from"react/jsx-runtime";function r(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}"function"==typeof SuppressedError&&SuppressedError;const o=new e({type:"Blockquote",elements:{blockquote:{render:e=>{var{extendRender:o}=e,n=r(e,["extendRender"]);const a=n.HTMLAttributes||{},{className:l=""}=a,i=r(a,["className"]);return o?o(n):t("blockquote",Object.assign({className:`yoopta-blockquote ${l}`},i,n.attributes,{children:n.children}))}}},options:{display:{title:"Blockquote",description:"Capture quote"},shortcuts:[">"]},parsers:{html:{deserialize:{nodeNames:["BLOCKQUOTE"]},serialize:(e,t,r)=>{const{align:o="left",depth:n=0}=r||{};return`<blockquote data-meta-align="${o}" data-meta-depth="${n}" style="margin-left: ${n}px; text-align: ${o}; border-left: 3px solid; color: #292929; padding: 2px 14px; margin-top: 8px;">${t}</blockquote>`}},markdown:{serialize:(e,t)=>`> ${t}`}}});!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoopta-blockquote{--tw-border-opacity:1;border-left-color:rgb(229 231 235/var(--tw-border-opacity));border-left-width:2px;line-height:1.75rem;margin:8px 0 0;padding-left:1.5rem}");export{o as default};
1
+ import{generateId as e,Blocks as t,buildBlockData as o,YooptaPlugin as r}from"@yoopta/editor";import{jsx as l}from"react/jsx-runtime";const n={buildBlockquoteElements:(t,o={})=>({id:e(),type:"blockquote",children:[{text:(null==o?void 0:o.text)||""}]}),insertBlockquote:(e,r={})=>{const{at:l,focus:a,text:i}=r,d=n.buildBlockquoteElements(e,{text:i});t.insertBlock(e,o({value:[d],type:"Blockquote"}),{at:l,focus:a})},deleteBlockquote:(e,o)=>{t.deleteBlock(e,{blockId:o})}};function a(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(r=Object.getOwnPropertySymbols(e);l<r.length;l++)t.indexOf(r[l])<0&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(o[r[l]]=e[r[l]])}return o}"function"==typeof SuppressedError&&SuppressedError;const i=new r({type:"Blockquote",elements:{blockquote:{render:e=>{var{extendRender:t}=e,o=a(e,["extendRender"]);const r=o.HTMLAttributes||{},{className:n=""}=r,i=a(r,["className"]);return t?t(o):l("blockquote",Object.assign({className:`yoopta-blockquote ${n}`},i,o.attributes,{children:o.children}))}}},options:{display:{title:"Blockquote",description:"Capture quote"},shortcuts:[">"]},commands:n,parsers:{html:{deserialize:{nodeNames:["BLOCKQUOTE"]},serialize:(e,t,o)=>{const{align:r="left",depth:l=0}=o||{};return`<blockquote data-meta-align="${r}" data-meta-depth="${l}" style="margin-left: ${l}px; text-align: ${r}; border-left: 3px solid; color: #292929; padding: 2px 14px; margin-top: 8px;">${t}</blockquote>`}},markdown:{serialize:(e,t)=>`> ${t}`}}});!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===o&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}(".yoopta-blockquote{--tw-border-opacity:1;border-left-color:rgb(229 231 235/var(--tw-border-opacity));border-left-width:2px;line-height:1.75rem;margin:8px 0 0;padding-left:1.5rem}");export{n as BlockquoteCommands,i as default};
@@ -1,5 +1,5 @@
1
1
  import { YooptaPlugin } from '@yoopta/editor';
2
- declare const Blockquote: YooptaPlugin<"blockquote", import("slate").Descendant, {
2
+ declare const Blockquote: YooptaPlugin<Record<string, import("@yoopta/editor").SlateElement<string, any>>, {
3
3
  display: {
4
4
  title: string;
5
5
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAIpE,QAAA,MAAM,UAAU;;;;;;EA8Bd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKpE,QAAA,MAAM,UAAU;;;;;;EA+Bd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/blockquote",
3
- "version": "4.7.0",
3
+ "version": "4.7.1-rc.1",
4
4
  "description": "Blockquote plugin for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
@@ -34,5 +34,5 @@
34
34
  "bugs": {
35
35
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
36
36
  },
37
- "gitHead": "4addd117eaf75c456f2e050f84a806945d1f2722"
37
+ "gitHead": "d3cdf3f45a5038dd9259af39d1a8c4eb9ad8a94c"
38
38
  }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/ui/Blockquote.tsx","../src/plugin/index.tsx","../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["import { PluginElementRenderProps } from '@yoopta/editor';\n\nconst BlockquoteRender = ({ extendRender, ...props }: PluginElementRenderProps) => {\n const { className = '', ...htmlAttrs } = props.HTMLAttributes || {};\n\n if (extendRender) {\n return extendRender(props);\n }\n\n return (\n <blockquote className={`yoopta-blockquote ${className}`} {...htmlAttrs} {...props.attributes}>\n {props.children}\n </blockquote>\n );\n};\n\nexport { BlockquoteRender };\n","import { Elements, generateId, YooptaPlugin } from '@yoopta/editor';\nimport { Element, Transforms } from 'slate';\nimport { BlockquoteRender } from '../ui/Blockquote';\n\nconst Blockquote = new YooptaPlugin({\n type: 'Blockquote',\n elements: {\n blockquote: {\n render: BlockquoteRender,\n },\n },\n options: {\n display: {\n title: 'Blockquote',\n description: 'Capture quote',\n },\n shortcuts: ['>'],\n },\n parsers: {\n html: {\n deserialize: {\n nodeNames: ['BLOCKQUOTE'],\n },\n serialize: (element, text, blockMeta) => {\n const { align = 'left', depth = 0 } = blockMeta || {};\n return `<blockquote data-meta-align=\"${align}\" data-meta-depth=\"${depth}\" style=\"margin-left: ${depth}px; text-align: ${align}; border-left: 3px solid; color: #292929; padding: 2px 14px; margin-top: 8px;\">${text}</blockquote>`;\n },\n },\n markdown: {\n serialize: (element, text) => {\n return `> ${text}`;\n },\n },\n },\n});\n\nexport { Blockquote };\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,gBAAgB,GAAG,CAAC,EAAoD,KAAI;AAAxD,IAAA,IAAA,EAAE,YAAY,EAAsC,GAAA,EAAA,EAAjC,KAAK,GAAA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