@corva/ui 3.75.0-5 → 3.75.0-6
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@babel/runtime/helpers/slicedToArray"),e=require("./fileExtension.js");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=r(t);function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){l=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(l)throw i}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var i="\\b".concat("[Hh][Tt][Tt][Pp][Ss]?","://[^\\s
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@babel/runtime/helpers/slicedToArray"),e=require("./fileExtension.js");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=r(t);function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){l=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(l)throw i}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var i="(?:".concat("\\([^\\s()<>]*\\)","|[^\\s<>()[\\].,;:!?'\"])"),u="\\b".concat("[Hh][Tt][Tt][Pp][Ss]?","://(?:").concat("\\([^\\s()<>]*\\)","|").concat("[^\\s<>()[\\]]",")*").concat(i),l=new RegExp(u,"g"),c=new RegExp("(".concat(u,")")),s=function(t){try{var e,r=new URL(t),n=r.protocol,o=r.pathname;return"http:"!==n&&"https:"!==n?"":decodeURIComponent(null!==(e=o.split("/").pop())&&void 0!==e?e:"")}catch(t){return""}};exports.URL_CAPTURE_PATTERN=c,exports.getIsImageUrl=function(t){return e.getIsImage(s(t))},exports.getUrlFileName=s,exports.readPastedLink=function(t){var e,r=t.trim();if(!r||/\s/.test(r))return"";var o=null!==(e=r.match(l))&&void 0!==e?e:[];return n.default(o,1)[0]===r?r:""},exports.splitOnLinks=function(t){var e,r=[],n=0,a=o(t.matchAll(l));try{for(a.s();!(e=a.n()).done;){var i,u=e.value,c=null!==(i=u.index)&&void 0!==i?i:0;c>n&&r.push({text:t.slice(n,c)}),r.push({text:u[0],url:u[0]}),n=c+u[0].length}}catch(t){a.e(t)}finally{a.f()}return n<t.length&&r.push({text:t.slice(n)}),r};
|
|
2
2
|
//# sourceMappingURL=links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.js","sources":["../../../src/utils/links.ts"],"sourcesContent":["import { getIsImage } from './fileExtension';\n\n// Spelled out rather than left to an `i` flag: react-mentions rejects a regex that carries one.\nconst SCHEME = '[Hh][Tt][Tt][Pp][Ss]?';\n\n// Trailing punctuation is far more often the sentence's than the url's.\nconst
|
|
1
|
+
{"version":3,"file":"links.js","sources":["../../../src/utils/links.ts"],"sourcesContent":["import { getIsImage } from './fileExtension';\n\n// Spelled out rather than left to an `i` flag: react-mentions rejects a regex that carries one.\nconst SCHEME = '[Hh][Tt][Tt][Pp][Ss]?';\n\n// Parentheses count as part of the url only in balanced pairs (\"/image%20(4).jpg\"),\n// so the closing paren of a sentence around the url stays with the sentence.\nconst PAREN_PAIR = '\\\\([^\\\\s()<>]*\\\\)';\nconst URL_CHAR = '[^\\\\s<>()[\\\\]]';\n\n// Trailing punctuation is far more often the sentence's than the url's.\nconst URL_END = `(?:${PAREN_PAIR}|[^\\\\s<>()[\\\\].,;:!?'\"])`;\n\nconst URL_SOURCE = `\\\\b${SCHEME}://(?:${PAREN_PAIR}|${URL_CHAR})*${URL_END}`;\n\nconst URL_PATTERN = new RegExp(URL_SOURCE, 'g');\n\n/** One capturing group and no flags, for callers that highlight through a library. */\nexport const URL_CAPTURE_PATTERN = new RegExp(`(${URL_SOURCE})`);\n\nexport type TextSegment = { text: string; url?: string };\n\nexport const splitOnLinks = (text: string): TextSegment[] => {\n const segments: TextSegment[] = [];\n let cursor = 0;\n\n for (const match of text.matchAll(URL_PATTERN)) {\n const start = match.index ?? 0;\n\n if (start > cursor) segments.push({ text: text.slice(cursor, start) });\n\n segments.push({ text: match[0], url: match[0] });\n cursor = start + match[0].length;\n }\n\n if (cursor < text.length) segments.push({ text: text.slice(cursor) });\n\n return segments;\n};\n\n/** The single link a paste consists of, or nothing when it is anything else. */\nexport const readPastedLink = (text: string): string => {\n const trimmed = text.trim();\n\n if (!trimmed || /\\s/.test(trimmed)) return '';\n\n const [match] = trimmed.match(URL_PATTERN) ?? [];\n\n return match === trimmed ? trimmed : '';\n};\n\n/** The file name in the path, without the query a signed url drags along. */\nexport const getUrlFileName = (url: string): string => {\n try {\n // Absolute only: anything else parses as a path relative to the page and looks like a name.\n const { protocol, pathname } = new URL(url);\n\n if (protocol !== 'http:' && protocol !== 'https:') return '';\n\n return decodeURIComponent(pathname.split('/').pop() ?? '');\n } catch {\n return '';\n }\n};\n\n/** Judged by the name in the path: reading the type would mean fetching it. */\nexport const getIsImageUrl = (url: string): boolean => getIsImage(getUrlFileName(url));\n"],"names":["URL_END","PAREN_PAIR","URL_SOURCE","concat","URL_CHAR","URL_PATTERN","RegExp","URL_CAPTURE_PATTERN","getUrlFileName","url","_pathname$split$pop","_URL","URL","protocol","pathname","decodeURIComponent","split","pop","_unused","getIsImage","text","_trimmed$match","trimmed","trim","test","_ref","match","_slicedToArray","_step","segments","cursor","_iterator","_createForOfIteratorHelper","matchAll","s","n","done","_match$index","value","start","index","push","slice","length","err","e","f"],"mappings":"iwCAGA,IAQMA,EAAgBC,MAAAA,OAJH,oBAIuC,6BAEpDC,eAVS,wBAUgB,UAAAC,OANZ,oBAMmCC,KAAAA,OALrC,iBAKkDJ,MAAAA,OAAAA,GAE7DK,EAAc,IAAIC,OAAOJ,EAAY,KAG9BK,EAAsB,IAAID,OAAM,IAAAH,OAAKD,EAAc,MAkCnDM,EAAiB,SAACC,GAC7B,IAAI,IAAAC,EAEFC,EAA+B,IAAIC,IAAIH,GAA/BI,IAAAA,SAAUC,IAAAA,SAElB,MAAiB,UAAbD,GAAqC,WAAbA,EAA8B,GAEnDE,mBAA4C,QAA1BL,EAACI,EAASE,MAAM,KAAKC,aAAK,IAAAP,EAAAA,EAAI,GAGzD,CAFE,MAAMQ,GACN,MAAO,EACT,CACF,sDAG6B,SAACT,GAAW,OAAcU,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