@react-fabric/lexical 1.0.0-beta.60 → 1.0.0-beta.61

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.
Files changed (127) hide show
  1. package/dist/cjs/{packages/lexical/src/components → components}/StickyComponent.js +2 -3
  2. package/dist/cjs/{packages/lexical/src/editor → editor}/LexicalEditor.js +5 -5
  3. package/dist/cjs/{packages/lexical/src/hooks → hooks}/useFormatWatcher.js +101 -95
  4. package/dist/cjs/i18n/ar.json.js +24 -0
  5. package/dist/cjs/i18n/en.json.js +24 -0
  6. package/dist/cjs/i18n/index.js +33 -0
  7. package/dist/cjs/{packages/lexical/src/index.js → index.js} +1 -0
  8. package/dist/cjs/{packages/lexical/src/plugins → plugins}/DraggableBlockPlugin.js +5 -5
  9. package/dist/cjs/{packages/lexical/src/plugins → plugins}/ToolbarPlugin.js +35 -22
  10. package/dist/esm/{packages/lexical/src/components → components}/StickyComponent.js +2 -3
  11. package/dist/esm/{packages/lexical/src/editor → editor}/LexicalEditor.js +4 -4
  12. package/dist/esm/{packages/lexical/src/hooks → hooks}/useFormatWatcher.js +43 -37
  13. package/dist/esm/i18n/ar.json.js +21 -0
  14. package/dist/esm/i18n/en.json.js +21 -0
  15. package/dist/esm/i18n/index.js +33 -0
  16. package/dist/esm/{packages/lexical/src/index.js → index.js} +1 -0
  17. package/dist/esm/{packages/lexical/src/plugins → plugins}/DraggableBlockPlugin.js +2 -2
  18. package/dist/esm/{packages/lexical/src/plugins → plugins}/ToolbarPlugin.js +36 -23
  19. package/dist/types/hooks/useFormatWatcher.d.ts +1 -0
  20. package/dist/types/i18n/index.d.ts +1 -0
  21. package/dist/types/index.d.ts +1 -0
  22. package/package.json +5 -5
  23. package/src/components/StickyComponent.tsx +2 -3
  24. package/src/hooks/useFormatWatcher.ts +3 -0
  25. package/src/i18n/ar.json +16 -0
  26. package/src/i18n/en.json +16 -0
  27. package/src/i18n/index.ts +28 -0
  28. package/src/index.ts +2 -0
  29. package/src/plugins/ToolbarPlugin.tsx +34 -23
  30. package/dist/cjs/_virtual/prism.js +0 -5
  31. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +0 -474
  32. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.js +0 -21
  33. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -27
  34. package/dist/cjs/node_modules/@lexical/code/LexicalCode.dev.js +0 -1537
  35. package/dist/cjs/node_modules/@lexical/code/LexicalCode.js +0 -25
  36. package/dist/cjs/node_modules/@lexical/code/LexicalCode.prod.js +0 -57
  37. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.dev.js +0 -252
  38. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.js +0 -19
  39. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.prod.js +0 -18
  40. package/dist/cjs/node_modules/@lexical/link/LexicalLink.dev.js +0 -572
  41. package/dist/cjs/node_modules/@lexical/link/LexicalLink.js +0 -17
  42. package/dist/cjs/node_modules/@lexical/link/LexicalLink.prod.js +0 -25
  43. package/dist/cjs/node_modules/@lexical/list/LexicalList.dev.js +0 -1614
  44. package/dist/cjs/node_modules/@lexical/list/LexicalList.js +0 -29
  45. package/dist/cjs/node_modules/@lexical/list/LexicalList.prod.js +0 -36
  46. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.dev.js +0 -838
  47. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.js +0 -29
  48. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -26
  49. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.dev.js +0 -1057
  50. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.js +0 -39
  51. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -45
  52. package/dist/cjs/node_modules/@lexical/table/LexicalTable.dev.js +0 -4207
  53. package/dist/cjs/node_modules/@lexical/table/LexicalTable.js +0 -23
  54. package/dist/cjs/node_modules/@lexical/table/LexicalTable.prod.js +0 -68
  55. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.dev.js +0 -1166
  56. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.js +0 -47
  57. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -81
  58. package/dist/cjs/node_modules/@mdi/js/mdi.js +0 -8
  59. package/dist/cjs/node_modules/prismjs/components/prism-c.js +0 -82
  60. package/dist/cjs/node_modules/prismjs/components/prism-clike.js +0 -33
  61. package/dist/cjs/node_modules/prismjs/components/prism-cpp.js +0 -101
  62. package/dist/cjs/node_modules/prismjs/components/prism-css.js +0 -66
  63. package/dist/cjs/node_modules/prismjs/components/prism-java.js +0 -126
  64. package/dist/cjs/node_modules/prismjs/components/prism-javascript.js +0 -174
  65. package/dist/cjs/node_modules/prismjs/components/prism-markdown.js +0 -417
  66. package/dist/cjs/node_modules/prismjs/components/prism-markup.js +0 -188
  67. package/dist/cjs/node_modules/prismjs/components/prism-objectivec.js +0 -14
  68. package/dist/cjs/node_modules/prismjs/components/prism-powershell.js +0 -60
  69. package/dist/cjs/node_modules/prismjs/components/prism-python.js +0 -67
  70. package/dist/cjs/node_modules/prismjs/components/prism-rust.js +0 -130
  71. package/dist/cjs/node_modules/prismjs/components/prism-sql.js +0 -34
  72. package/dist/cjs/node_modules/prismjs/components/prism-swift.js +0 -150
  73. package/dist/cjs/node_modules/prismjs/components/prism-typescript.js +0 -62
  74. package/dist/cjs/node_modules/prismjs/prism.js +0 -1951
  75. package/dist/esm/_virtual/prism.js +0 -5
  76. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +0 -465
  77. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.js +0 -19
  78. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -18
  79. package/dist/esm/node_modules/@lexical/code/LexicalCode.dev.js +0 -1512
  80. package/dist/esm/node_modules/@lexical/code/LexicalCode.js +0 -21
  81. package/dist/esm/node_modules/@lexical/code/LexicalCode.prod.js +0 -32
  82. package/dist/esm/node_modules/@lexical/html/LexicalHtml.dev.js +0 -251
  83. package/dist/esm/node_modules/@lexical/html/LexicalHtml.js +0 -18
  84. package/dist/esm/node_modules/@lexical/html/LexicalHtml.prod.js +0 -17
  85. package/dist/esm/node_modules/@lexical/link/LexicalLink.dev.js +0 -563
  86. package/dist/esm/node_modules/@lexical/link/LexicalLink.js +0 -17
  87. package/dist/esm/node_modules/@lexical/link/LexicalLink.prod.js +0 -16
  88. package/dist/esm/node_modules/@lexical/list/LexicalList.dev.js +0 -1595
  89. package/dist/esm/node_modules/@lexical/list/LexicalList.js +0 -23
  90. package/dist/esm/node_modules/@lexical/list/LexicalList.prod.js +0 -17
  91. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.dev.js +0 -830
  92. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.js +0 -23
  93. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -18
  94. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.dev.js +0 -1028
  95. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.js +0 -28
  96. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -16
  97. package/dist/esm/node_modules/@lexical/table/LexicalTable.dev.js +0 -4156
  98. package/dist/esm/node_modules/@lexical/table/LexicalTable.js +0 -20
  99. package/dist/esm/node_modules/@lexical/table/LexicalTable.prod.js +0 -17
  100. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.dev.js +0 -1102
  101. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.js +0 -32
  102. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -17
  103. package/dist/esm/node_modules/@mdi/js/mdi.js +0 -7
  104. package/dist/esm/node_modules/prismjs/components/prism-c.js +0 -82
  105. package/dist/esm/node_modules/prismjs/components/prism-clike.js +0 -33
  106. package/dist/esm/node_modules/prismjs/components/prism-cpp.js +0 -101
  107. package/dist/esm/node_modules/prismjs/components/prism-css.js +0 -66
  108. package/dist/esm/node_modules/prismjs/components/prism-java.js +0 -126
  109. package/dist/esm/node_modules/prismjs/components/prism-javascript.js +0 -174
  110. package/dist/esm/node_modules/prismjs/components/prism-markdown.js +0 -417
  111. package/dist/esm/node_modules/prismjs/components/prism-markup.js +0 -188
  112. package/dist/esm/node_modules/prismjs/components/prism-objectivec.js +0 -14
  113. package/dist/esm/node_modules/prismjs/components/prism-powershell.js +0 -60
  114. package/dist/esm/node_modules/prismjs/components/prism-python.js +0 -67
  115. package/dist/esm/node_modules/prismjs/components/prism-rust.js +0 -130
  116. package/dist/esm/node_modules/prismjs/components/prism-sql.js +0 -34
  117. package/dist/esm/node_modules/prismjs/components/prism-swift.js +0 -150
  118. package/dist/esm/node_modules/prismjs/components/prism-typescript.js +0 -62
  119. package/dist/esm/node_modules/prismjs/prism.js +0 -1951
  120. /package/dist/cjs/{packages/lexical/src/editor → editor}/theme.js +0 -0
  121. /package/dist/cjs/{packages/lexical/src/nodes → nodes}/StickyNode.js +0 -0
  122. /package/dist/cjs/{packages/lexical/src/plugins → plugins}/StickyPlugin.js +0 -0
  123. /package/dist/cjs/{packages/lexical/src/utils → utils}/index.js +0 -0
  124. /package/dist/esm/{packages/lexical/src/editor → editor}/theme.js +0 -0
  125. /package/dist/esm/{packages/lexical/src/nodes → nodes}/StickyNode.js +0 -0
  126. /package/dist/esm/{packages/lexical/src/plugins → plugins}/StickyPlugin.js +0 -0
  127. /package/dist/esm/{packages/lexical/src/utils → utils}/index.js +0 -0
@@ -1,47 +0,0 @@
1
- 'use strict';
2
-
3
- var LexicalUtils_dev = require('./LexicalUtils.dev.js');
4
- var LexicalUtils_prod = require('./LexicalUtils.prod.js');
5
-
6
- /**
7
- * Copyright (c) Meta Platforms, Inc. and affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- *
12
- */
13
-
14
- const mod = process.env.NODE_ENV !== 'production' ? LexicalUtils_dev : LexicalUtils_prod;
15
- const $descendantsMatching = mod.$descendantsMatching;
16
- const $findMatchingParent = mod.$findMatchingParent;
17
- const $getAdjacentCaret = mod.$getAdjacentCaret;
18
- const $getNearestBlockElementAncestorOrThrow = mod.$getNearestBlockElementAncestorOrThrow;
19
- const $getNearestNodeOfType = mod.$getNearestNodeOfType;
20
- const $insertFirst = mod.$insertFirst;
21
- const $insertNodeToNearestRoot = mod.$insertNodeToNearestRoot;
22
- const $unwrapAndFilterDescendants = mod.$unwrapAndFilterDescendants;
23
- const addClassNamesToElement = mod.addClassNamesToElement;
24
- const calculateZoomLevel = mod.calculateZoomLevel;
25
- const isBlockDomNode = mod.isBlockDomNode;
26
- const isHTMLAnchorElement = mod.isHTMLAnchorElement;
27
- const isHTMLElement = mod.isHTMLElement;
28
- const mergeRegister = mod.mergeRegister;
29
- const objectKlassEquals = mod.objectKlassEquals;
30
- const removeClassNamesFromElement = mod.removeClassNamesFromElement;
31
-
32
- exports.$descendantsMatching = $descendantsMatching;
33
- exports.$findMatchingParent = $findMatchingParent;
34
- exports.$getAdjacentCaret = $getAdjacentCaret;
35
- exports.$getNearestBlockElementAncestorOrThrow = $getNearestBlockElementAncestorOrThrow;
36
- exports.$getNearestNodeOfType = $getNearestNodeOfType;
37
- exports.$insertFirst = $insertFirst;
38
- exports.$insertNodeToNearestRoot = $insertNodeToNearestRoot;
39
- exports.$unwrapAndFilterDescendants = $unwrapAndFilterDescendants;
40
- exports.addClassNamesToElement = addClassNamesToElement;
41
- exports.calculateZoomLevel = calculateZoomLevel;
42
- exports.isBlockDomNode = isBlockDomNode;
43
- exports.isHTMLAnchorElement = isHTMLAnchorElement;
44
- exports.isHTMLElement = isHTMLElement;
45
- exports.mergeRegister = mergeRegister;
46
- exports.objectKlassEquals = objectKlassEquals;
47
- exports.removeClassNamesFromElement = removeClassNamesFromElement;
@@ -1,81 +0,0 @@
1
- 'use strict';
2
-
3
- var lexical = require('lexical');
4
- var LexicalSelection = require('../selection/LexicalSelection.js');
5
-
6
- /**
7
- * Copyright (c) Meta Platforms, Inc. and affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- *
12
- */
13
-
14
- function N(t,...e){const n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const t of e)o.append("v",t);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const M="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,R=M&&"documentMode"in document?document.documentMode:null,T=M&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),B=M&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_=!(!M||!("InputEvent"in window)||R)&&"getTargetRanges"in new window.InputEvent("input"),k=M&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),K=M&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,H=M&&/Android/.test(navigator.userAgent),O=M&&/^(?=.*Chrome).*/i.test(navigator.userAgent),$=M&&H&&O,D=M&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!O;function I(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}function j(...t){return ()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0;}}function F(t){return `${t}px`}const U={attributes:!0,characterData:!0,childList:!0,subtree:!0};function z(e,n,o){let r=null,i=null,l=null,u=[];const s=document.createElement("div");function c(){null===r&&N(182),null===i&&N(183);const{left:t,top:l}=i.getBoundingClientRect(),c=LexicalSelection.createRectsFromDOMRange(e,n);var f,a;s.isConnected||(a=s,(f=i).insertBefore(a,f.firstChild));let d=!1;for(let e=0;e<c.length;e++){const n=c[e],o=u[e]||document.createElement("div"),r=o.style;"absolute"!==r.position&&(r.position="absolute",d=!0);const i=F(n.left-t);r.left!==i&&(r.left=i,d=!0);const f=F(n.top-l);r.top!==f&&(o.style.top=f,d=!0);const a=F(n.width);r.width!==a&&(o.style.width=a,d=!0);const g=F(n.height);r.height!==g&&(o.style.height=g,d=!0),o.parentNode!==s&&(s.append(o),d=!0),u[e]=o;}for(;u.length>c.length;)u.pop();d&&o(u);}function f(){i=null,r=null,null!==l&&l.disconnect(),l=null,s.remove();for(const t of u)t.remove();u=[];}s.style.position="relative";const a=e.registerRootListener((function n(){const o=e.getRootElement();if(null===o)return f();const u=o.parentElement;if(!lexical.isHTMLElement(u))return f();f(),r=o,i=u,l=new MutationObserver((t=>{const o=e.getRootElement(),l=o&&o.parentElement;if(o!==r||l!==i)return n();for(const e of t)if(!s.contains(e.target))return c()})),l.observe(u,U),c();}));return ()=>{a(),f();}}function V(t,e,n){if("text"!==t.type&&lexical.$isElementNode(e)){const o=e.getDOMSlot(n);return [o.element,o.getFirstChildOffset()+t.offset]}return [lexical.getDOMTextNode(n)||n,t.offset]}function W(t,o){let r=null,i=null,l=null,u=null,s=null,c=null,f=()=>{};function a(a){a.read((()=>{const a=lexical.$getSelection();if(!lexical.$isRangeSelection(a))return r=null,l=null,u=null,c=null,f(),void(f=()=>{});const[d,g]=function(t){const e=t.getStartEndPoints();return t.isBackward()?[e[1],e[0]]:e}(a),p=d.getNode(),m=p.getKey(),h=d.offset,v=g.getNode(),y=v.getKey(),w=g.offset,x=t.getElementByKey(m),E=t.getElementByKey(y),S=null===r||x!==i||h!==l||m!==r.getKey(),A=null===u||E!==s||w!==c||y!==u.getKey();if((S||A)&&null!==x&&null!==E){const e=function(t,e,n,o,r,i,l){const u=(t._window?t._window.document:document).createRange();return u.setStart(...V(e,n,o)),u.setEnd(...V(r,i,l)),u}(t,d,p,x,g,v,E);f(),f=z(t,e,(t=>{if(void 0===o)for(const e of t){const t=e.style;"Highlight"!==t.background&&(t.background="Highlight"),"HighlightText"!==t.color&&(t.color="HighlightText"),t.marginTop!==F(-1.5)&&(t.marginTop=F(-1.5)),t.paddingTop!==F(4)&&(t.paddingTop=F(4)),t.paddingBottom!==F(0)&&(t.paddingBottom=F(0));}else o(t);}));}r=p,i=x,l=h,u=v,s=E,c=w;}));}return a(t.getEditorState()),j(t.registerUpdateListener((({editorState:t})=>a(t))),(()=>{f();}))}function G(t){let e=null;const n=()=>{const n=getSelection(),o=n&&n.anchorNode,r=t.getRootElement();null!==o&&null!==r&&r.contains(o)?null!==e&&(e(),e=null):null===e&&(e=W(t));};return document.addEventListener("selectionchange",n),()=>{null!==e&&e(),document.removeEventListener("selectionchange",n);}}const q=_,J=M,Q=H,X=$,Y=T,Z=D,tt=O,et=B,nt=K,ot=k;function rt(t,...e){const n=I(...e);n.length>0&&t.classList.add(...n);}function it(t,...e){const n=I(...e);n.length>0&&t.classList.remove(...n);}function lt(t,e){for(const n of e)if(t.type.startsWith(n))return !0;return !1}function ut(t,e){const n=t[Symbol.iterator]();return new Promise(((t,o)=>{const r=[],i=()=>{const{done:l,value:u}=n.next();if(l)return t(r);const s=new FileReader;s.addEventListener("error",o),s.addEventListener("load",(()=>{const t=s.result;"string"==typeof t&&r.push({file:u,result:t}),i();})),lt(u,e)?s.readAsDataURL(u):i();};i();}))}function st(t,e){return Array.from(at(t,e))}function ct(t){return t?t.getAdjacentCaret():null}function ft(t,e){return Array.from(ht(t,e))}function at(t,e){return dt("next",t,e)}function dt(t,e,n){const r=lexical.$getRoot(),d=e||r,g=lexical.$isElementNode(d)?lexical.$getChildCaret(d,t):lexical.$getSiblingCaret(d,t),p=pt(d),m=n?lexical.$getAdjacentChildCaret(lexical.$getChildCaretOrSelf(lexical.$getSiblingCaret(n,t))):function(t,e){const n=$t(lexical.$getSiblingCaret(t,e));return n&&n[0]}(d,t);let h=p;return lexical.makeStepwiseIterator({hasNext:t=>null!==t,initial:g,map:t=>({depth:h,node:t.origin}),step:t=>{if(t.isSameNodeCaret(m))return null;lexical.$isChildCaret(t)&&h++;const e=$t(t);return !e||e[0].isSameNodeCaret(m)?null:(h+=e[1],e[0])}})}function gt(t){const e=$t(lexical.$getSiblingCaret(t,"next"));return e&&[e[0].origin,e[1]]}function pt(t){let e=-1;for(let n=t;null!==n;n=n.getParent())e++;return e}function mt(t){const e=$t(lexical.$getChildCaretOrSelf(lexical.$getSiblingCaret(t,"previous")),"root");return e&&e[0].origin}function ht(t,e){return dt("previous",t,e)}function vt(t,e){let n=t;for(;null!=n;){if(n instanceof e)return n;n=n.getParent();}return null}function yt(t){const e=wt(t,(t=>lexical.$isElementNode(t)&&!t.isInline()));return lexical.$isElementNode(e)||N(4,t.__key),e}const wt=(t,e)=>{let n=t;for(;n!==lexical.$getRoot()&&null!=n;){if(e(n))return n;n=n.getParent();}return null};function xt(t,e,n,o){const r=t=>t instanceof e;return t.registerNodeTransform(e,(t=>{const e=(t=>{const e=t.getChildren();for(let t=0;t<e.length;t++){const n=e[t];if(r(n))return null}let n=t,o=t;for(;null!==n;)if(o=n,n=n.getParent(),r(n))return {child:o,parent:n};return null})(t);if(null!==e){const{child:r,parent:i}=e;if(r.is(t)){o(i,t);const e=r.getNextSiblings(),l=e.length;if(i.insertAfter(r),0!==l){const t=n(i);r.insertAfter(t);for(let n=0;n<l;n++)t.append(e[n]);}i.canBeEmpty()||0!==i.getChildrenSize()||i.remove();}}}))}function Et(t,e){const n=new Map,o=t._pendingEditorState;for(const[t,o]of e._nodeMap)n.set(t,lexical.$cloneWithProperties(o));o&&(o._nodeMap=n),t._dirtyType=2;const r=e._selection;lexical.$setSelection(null===r?null:r.clone());}function St(t){const o=lexical.$getSelection()||lexical.$getPreviousSelection();let r;if(lexical.$isRangeSelection(o))r=lexical.$caretFromPoint(o.focus,"next");else {if(null!=o){const t=o.getNodes(),e=t[t.length-1];e&&(r=lexical.$getSiblingCaret(e,"next"));}r=r||lexical.$getChildCaret(lexical.$getRoot(),"previous").getFlipped().insert(lexical.$createParagraphNode());}const c=At(t,r),f=lexical.$getAdjacentChildCaret(c),d=lexical.$isChildCaret(f)?lexical.$normalizeCaret(f):c;return lexical.$setSelectionFromCaretRange(lexical.$getCollapsedCaretRange(d)),t.getLatest()}function At(t,e,n){let o=lexical.$getCaretInDirection(e,"next");for(let t=o;t;t=lexical.$splitAtPointCaretNext(t,n))o=t;return lexical.$isTextPointCaret(o)&&N(283),o.insert(t.isInline()?lexical.$createParagraphNode().append(t):t),lexical.$getCaretInDirection(lexical.$getSiblingCaret(t.getLatest(),"next"),e.direction)}function Ct(t,e){const n=e();return t.replace(n),n.append(t),n}function Lt(t,e){return null!==t&&Object.getPrototypeOf(t).constructor.name===e.name}function Pt(t,e){const n=[];for(let o=0;o<t.length;o++){const r=e(t[o]);null!==r&&n.push(r);}return n}function bt(t,e){lexical.$getChildCaret(t,"next").insert(e);}let Nt=!(et||!J)&&void 0;function Mt(t){let e=1;if(function(){if(void 0===Nt){const t=document.createElement("div");t.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(t);const e=t.getBoundingClientRect();t.style.setProperty("zoom","2"),Nt=t.getBoundingClientRect().width===e.width,document.body.removeChild(t);}return Nt}())for(;t;)e*=Number(window.getComputedStyle(t).getPropertyValue("zoom")),t=t.parentElement;return e}function Rt(t){return null!==t._parentEditor}function Tt(t,e){return Bt(t,e,null)}function Bt(t,e,n){let r=!1;for(const i of Kt(t))e(i)?null!==n&&n(i):(r=!0,lexical.$isElementNode(i)&&Bt(i,e,n||(t=>i.insertAfter(t))),i.remove());return r}function _t(t,e){const n=[],r=Array.from(t).reverse();for(let t=r.pop();void 0!==t;t=r.pop())if(e(t))n.push(t);else if(lexical.$isElementNode(t))for(const e of Kt(t))r.push(e);return n}function kt(t){return Ht(lexical.$getChildCaret(t,"next"))}function Kt(t){return Ht(lexical.$getChildCaret(t,"previous"))}function Ht(t){return lexical.makeStepwiseIterator({hasNext:lexical.$isSiblingCaret,initial:t.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function Ot(t){lexical.$rewindSiblingCaret(lexical.$getSiblingCaret(t,"next")).splice(1,t.getChildren());}function $t(t,e="root"){let n=0,o=t,r=lexical.$getAdjacentChildCaret(o);for(;null===r;){if(n--,r=o.getParentCaret(e),!r)return null;o=r,r=lexical.$getAdjacentChildCaret(o);}return r&&[r,n]}function Dt(t){const e=e=>lexical.$getState(e,t),n=(e,n)=>lexical.$setState(e,t,n);return {$get:e,$set:n,accessors:[e,n],makeGetterMethod:()=>function(){return e(this)},makeSetterMethod:()=>function(t){return n(this,t)},stateConfig:t}}
15
-
16
- Object.defineProperty(exports, "$splitNode", {
17
- enumerable: true,
18
- get: function () { return lexical.$splitNode; }
19
- });
20
- Object.defineProperty(exports, "isBlockDomNode", {
21
- enumerable: true,
22
- get: function () { return lexical.isBlockDomNode; }
23
- });
24
- Object.defineProperty(exports, "isHTMLAnchorElement", {
25
- enumerable: true,
26
- get: function () { return lexical.isHTMLAnchorElement; }
27
- });
28
- Object.defineProperty(exports, "isHTMLElement", {
29
- enumerable: true,
30
- get: function () { return lexical.isHTMLElement; }
31
- });
32
- Object.defineProperty(exports, "isInlineDomNode", {
33
- enumerable: true,
34
- get: function () { return lexical.isInlineDomNode; }
35
- });
36
- exports.$descendantsMatching = _t;
37
- exports.$dfs = st;
38
- exports.$dfsIterator = at;
39
- exports.$filter = Pt;
40
- exports.$findMatchingParent = wt;
41
- exports.$firstToLastIterator = kt;
42
- exports.$getAdjacentCaret = ct;
43
- exports.$getAdjacentSiblingOrParentSiblingCaret = $t;
44
- exports.$getDepth = pt;
45
- exports.$getNearestBlockElementAncestorOrThrow = yt;
46
- exports.$getNearestNodeOfType = vt;
47
- exports.$getNextRightPreorderNode = mt;
48
- exports.$getNextSiblingOrParentSibling = gt;
49
- exports.$insertFirst = bt;
50
- exports.$insertNodeToNearestRoot = St;
51
- exports.$insertNodeToNearestRootAtCaret = At;
52
- exports.$isEditorIsNestedEditor = Rt;
53
- exports.$lastToFirstIterator = Kt;
54
- exports.$restoreEditorState = Et;
55
- exports.$reverseDfs = ft;
56
- exports.$reverseDfsIterator = ht;
57
- exports.$unwrapAndFilterDescendants = Tt;
58
- exports.$unwrapNode = Ot;
59
- exports.$wrapNodeInElement = Ct;
60
- exports.CAN_USE_BEFORE_INPUT = q;
61
- exports.CAN_USE_DOM = J;
62
- exports.IS_ANDROID = Q;
63
- exports.IS_ANDROID_CHROME = X;
64
- exports.IS_APPLE = Y;
65
- exports.IS_APPLE_WEBKIT = Z;
66
- exports.IS_CHROME = tt;
67
- exports.IS_FIREFOX = et;
68
- exports.IS_IOS = nt;
69
- exports.IS_SAFARI = ot;
70
- exports.addClassNamesToElement = rt;
71
- exports.calculateZoomLevel = Mt;
72
- exports.isMimeType = lt;
73
- exports.makeStateWrapper = Dt;
74
- exports.markSelection = W;
75
- exports.mediaFileReader = ut;
76
- exports.mergeRegister = j;
77
- exports.objectKlassEquals = Lt;
78
- exports.positionNodeOnRange = z;
79
- exports.registerNestedElementResolver = xt;
80
- exports.removeClassNamesFromElement = it;
81
- exports.selectionAlwaysOnDisplay = G;
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- // Material Design Icons v7.4.47
4
- var mdiClose = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";
5
- var mdiFormatColorFill = "M19,11.5C19,11.5 17,13.67 17,15A2,2 0 0,0 19,17A2,2 0 0,0 21,15C21,13.67 19,11.5 19,11.5M5.21,10L10,5.21L14.79,10M16.56,8.94L7.62,0L6.21,1.41L8.59,3.79L3.44,8.94C2.85,9.5 2.85,10.47 3.44,11.06L8.94,16.56C9.23,16.85 9.62,17 10,17C10.38,17 10.77,16.85 11.06,16.56L16.56,11.06C17.15,10.47 17.15,9.5 16.56,8.94Z";
6
-
7
- exports.mdiClose = mdiClose;
8
- exports.mdiFormatColorFill = mdiFormatColorFill;
@@ -1,82 +0,0 @@
1
- 'use strict';
2
-
3
- Prism.languages.c = Prism.languages.extend('clike', {
4
- 'comment': {
5
- pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
6
- greedy: true
7
- },
8
- 'string': {
9
- // https://en.cppreference.com/w/c/language/string_literal
10
- pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
11
- greedy: true
12
- },
13
- 'class-name': {
14
- pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
15
- lookbehind: true
16
- },
17
- 'keyword': /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
18
- 'function': /\b[a-z_]\w*(?=\s*\()/i,
19
- 'number': /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
20
- 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
21
- });
22
-
23
- Prism.languages.insertBefore('c', 'string', {
24
- 'char': {
25
- // https://en.cppreference.com/w/c/language/character_constant
26
- pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
27
- greedy: true
28
- }
29
- });
30
-
31
- Prism.languages.insertBefore('c', 'string', {
32
- 'macro': {
33
- // allow for multiline macro definitions
34
- // spaces after the # character compile fine with gcc
35
- pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
36
- lookbehind: true,
37
- greedy: true,
38
- alias: 'property',
39
- inside: {
40
- 'string': [
41
- {
42
- // highlight the path of the include statement as a string
43
- pattern: /^(#\s*include\s*)<[^>]+>/,
44
- lookbehind: true
45
- },
46
- Prism.languages.c['string']
47
- ],
48
- 'char': Prism.languages.c['char'],
49
- 'comment': Prism.languages.c['comment'],
50
- 'macro-name': [
51
- {
52
- pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
53
- lookbehind: true
54
- },
55
- {
56
- pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
57
- lookbehind: true,
58
- alias: 'function'
59
- }
60
- ],
61
- // highlight macro directives as keywords
62
- 'directive': {
63
- pattern: /^(#\s*)[a-z]+/,
64
- lookbehind: true,
65
- alias: 'keyword'
66
- },
67
- 'directive-hash': /^#/,
68
- 'punctuation': /##|\\(?=[\r\n])/,
69
- 'expression': {
70
- pattern: /\S[\s\S]*/,
71
- inside: Prism.languages.c
72
- }
73
- }
74
- }
75
- });
76
-
77
- Prism.languages.insertBefore('c', 'function', {
78
- // highlight predefined macros as constants
79
- 'constant': /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
80
- });
81
-
82
- delete Prism.languages.c['boolean'];
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- Prism.languages.clike = {
4
- 'comment': [
5
- {
6
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
7
- lookbehind: true,
8
- greedy: true
9
- },
10
- {
11
- pattern: /(^|[^\\:])\/\/.*/,
12
- lookbehind: true,
13
- greedy: true
14
- }
15
- ],
16
- 'string': {
17
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
18
- greedy: true
19
- },
20
- 'class-name': {
21
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
22
- lookbehind: true,
23
- inside: {
24
- 'punctuation': /[.\\]/
25
- }
26
- },
27
- 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
28
- 'boolean': /\b(?:false|true)\b/,
29
- 'function': /\b\w+(?=\()/,
30
- 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
31
- 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
32
- 'punctuation': /[{}[\];(),.:]/
33
- };
@@ -1,101 +0,0 @@
1
- 'use strict';
2
-
3
- (function (Prism) {
4
-
5
- var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;
6
- var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function () { return keyword.source; });
7
-
8
- Prism.languages.cpp = Prism.languages.extend('c', {
9
- 'class-name': [
10
- {
11
- pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source
12
- .replace(/<keyword>/g, function () { return keyword.source; })),
13
- lookbehind: true
14
- },
15
- // This is intended to capture the class name of method implementations like:
16
- // void foo::bar() const {}
17
- // However! The `foo` in the above example could also be a namespace, so we only capture the class name if
18
- // it starts with an uppercase letter. This approximation should give decent results.
19
- /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,
20
- // This will capture the class name before destructors like:
21
- // Foo::~Foo() {}
22
- /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,
23
- // This also intends to capture the class name of method implementations but here the class has template
24
- // parameters, so it can't be a namespace (until C++ adds generic namespaces).
25
- /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
26
- ],
27
- 'keyword': keyword,
28
- 'number': {
29
- pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
30
- greedy: true
31
- },
32
- 'operator': />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
33
- 'boolean': /\b(?:false|true)\b/
34
- });
35
-
36
- Prism.languages.insertBefore('cpp', 'string', {
37
- 'module': {
38
- // https://en.cppreference.com/w/cpp/language/modules
39
- pattern: RegExp(
40
- /(\b(?:import|module)\s+)/.source +
41
- '(?:' +
42
- // header-name
43
- /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source +
44
- '|' +
45
- // module name or partition or both
46
- /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, function () { return modName; }) +
47
- ')'
48
- ),
49
- lookbehind: true,
50
- greedy: true,
51
- inside: {
52
- 'string': /^[<"][\s\S]+/,
53
- 'operator': /:/,
54
- 'punctuation': /\./
55
- }
56
- },
57
- 'raw-string': {
58
- pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
59
- alias: 'string',
60
- greedy: true
61
- }
62
- });
63
-
64
- Prism.languages.insertBefore('cpp', 'keyword', {
65
- 'generic-function': {
66
- pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
67
- inside: {
68
- 'function': /^\w+/,
69
- 'generic': {
70
- pattern: /<[\s\S]+/,
71
- alias: 'class-name',
72
- inside: Prism.languages.cpp
73
- }
74
- }
75
- }
76
- });
77
-
78
- Prism.languages.insertBefore('cpp', 'operator', {
79
- 'double-colon': {
80
- pattern: /::/,
81
- alias: 'punctuation'
82
- }
83
- });
84
-
85
- Prism.languages.insertBefore('cpp', 'class-name', {
86
- // the base clause is an optional list of parent classes
87
- // https://en.cppreference.com/w/cpp/language/class
88
- 'base-clause': {
89
- pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
90
- lookbehind: true,
91
- greedy: true,
92
- inside: Prism.languages.extend('cpp', {})
93
- }
94
- });
95
-
96
- Prism.languages.insertBefore('inside', 'double-colon', {
97
- // All untokenized words that are not namespaces should be class names
98
- 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i
99
- }, Prism.languages.cpp['base-clause']);
100
-
101
- }(Prism));
@@ -1,66 +0,0 @@
1
- 'use strict';
2
-
3
- (function (Prism) {
4
-
5
- var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
6
-
7
- Prism.languages.css = {
8
- 'comment': /\/\*[\s\S]*?\*\//,
9
- 'atrule': {
10
- pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
11
- inside: {
12
- 'rule': /^@[\w-]+/,
13
- 'selector-function-argument': {
14
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
15
- lookbehind: true,
16
- alias: 'selector'
17
- },
18
- 'keyword': {
19
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
20
- lookbehind: true
21
- }
22
- // See rest below
23
- }
24
- },
25
- 'url': {
26
- // https://drafts.csswg.org/css-values-3/#urls
27
- pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
28
- greedy: true,
29
- inside: {
30
- 'function': /^url/i,
31
- 'punctuation': /^\(|\)$/,
32
- 'string': {
33
- pattern: RegExp('^' + string.source + '$'),
34
- alias: 'url'
35
- }
36
- }
37
- },
38
- 'selector': {
39
- pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
40
- lookbehind: true
41
- },
42
- 'string': {
43
- pattern: string,
44
- greedy: true
45
- },
46
- 'property': {
47
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
48
- lookbehind: true
49
- },
50
- 'important': /!important\b/i,
51
- 'function': {
52
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
53
- lookbehind: true
54
- },
55
- 'punctuation': /[(){};:,]/
56
- };
57
-
58
- Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
59
-
60
- var markup = Prism.languages.markup;
61
- if (markup) {
62
- markup.tag.addInlined('style', 'css');
63
- markup.tag.addAttribute('style', 'css');
64
- }
65
-
66
- }(Prism));
@@ -1,126 +0,0 @@
1
- 'use strict';
2
-
3
- (function (Prism) {
4
-
5
- var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
6
-
7
- // full package (optional) + parent classes (optional)
8
- var classNamePrefix = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;
9
-
10
- // based on the java naming conventions
11
- var className = {
12
- pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
13
- lookbehind: true,
14
- inside: {
15
- 'namespace': {
16
- pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
17
- inside: {
18
- 'punctuation': /\./
19
- }
20
- },
21
- 'punctuation': /\./
22
- }
23
- };
24
-
25
- Prism.languages.java = Prism.languages.extend('clike', {
26
- 'string': {
27
- pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
28
- lookbehind: true,
29
- greedy: true
30
- },
31
- 'class-name': [
32
- className,
33
- {
34
- // variables, parameters, and constructor references
35
- // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
36
- pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
37
- lookbehind: true,
38
- inside: className.inside
39
- },
40
- {
41
- // class names based on keyword
42
- // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
43
- pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + classNamePrefix + /[A-Z]\w*\b/.source),
44
- lookbehind: true,
45
- inside: className.inside
46
- }
47
- ],
48
- 'keyword': keywords,
49
- 'function': [
50
- Prism.languages.clike.function,
51
- {
52
- pattern: /(::\s*)[a-z_]\w*/,
53
- lookbehind: true
54
- }
55
- ],
56
- 'number': /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
57
- 'operator': {
58
- pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
59
- lookbehind: true
60
- },
61
- 'constant': /\b[A-Z][A-Z_\d]+\b/
62
- });
63
-
64
- Prism.languages.insertBefore('java', 'string', {
65
- 'triple-quoted-string': {
66
- // http://openjdk.java.net/jeps/355#Description
67
- pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
68
- greedy: true,
69
- alias: 'string'
70
- },
71
- 'char': {
72
- pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
73
- greedy: true
74
- }
75
- });
76
-
77
- Prism.languages.insertBefore('java', 'class-name', {
78
- 'annotation': {
79
- pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
80
- lookbehind: true,
81
- alias: 'punctuation'
82
- },
83
- 'generics': {
84
- pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
85
- inside: {
86
- 'class-name': className,
87
- 'keyword': keywords,
88
- 'punctuation': /[<>(),.:]/,
89
- 'operator': /[?&|]/
90
- }
91
- },
92
- 'import': [
93
- {
94
- pattern: RegExp(/(\bimport\s+)/.source + classNamePrefix + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
95
- lookbehind: true,
96
- inside: {
97
- 'namespace': className.inside.namespace,
98
- 'punctuation': /\./,
99
- 'operator': /\*/,
100
- 'class-name': /\w+/
101
- }
102
- },
103
- {
104
- pattern: RegExp(/(\bimport\s+static\s+)/.source + classNamePrefix + /(?:\w+|\*)(?=\s*;)/.source),
105
- lookbehind: true,
106
- alias: 'static',
107
- inside: {
108
- 'namespace': className.inside.namespace,
109
- 'static': /\b\w+$/,
110
- 'punctuation': /\./,
111
- 'operator': /\*/,
112
- 'class-name': /\w+/
113
- }
114
- }
115
- ],
116
- 'namespace': {
117
- pattern: RegExp(
118
- /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/
119
- .source.replace(/<keyword>/g, function () { return keywords.source; })),
120
- lookbehind: true,
121
- inside: {
122
- 'punctuation': /\./,
123
- }
124
- }
125
- });
126
- }(Prism));