@favware/syntax-highlighter-react
Advanced tools
| export interface EventEmitter<T = any> { | ||
| emit: (data?: T) => CustomEvent<T>; | ||
| } | ||
| export interface StyleReactProps { | ||
| class?: string; | ||
| className?: string; | ||
| style?: { | ||
| [key: string]: any; | ||
| }; | ||
| } | ||
| export interface OverlayEventDetail<T = any> { | ||
| data?: T; | ||
| role?: string; | ||
| } | ||
| export interface OverlayInterface { | ||
| el: HTMLElement; | ||
| animated: boolean; | ||
| keyboardClose: boolean; | ||
| overlayIndex: number; | ||
| presented: boolean; | ||
| enterAnimation?: any; | ||
| leaveAnimation?: any; | ||
| didPresent: EventEmitter<void>; | ||
| willPresent: EventEmitter<void>; | ||
| willDismiss: EventEmitter<OverlayEventDetail>; | ||
| didDismiss: EventEmitter<OverlayEventDetail>; | ||
| present(): Promise<void>; | ||
| dismiss(data?: any, role?: string): Promise<boolean>; | ||
| } | ||
| // # sourceMappingURL=interfaces.d.ts.map |
| {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/react-component-lib/interfaces.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG;IACnC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,GAAG;IACzC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,WAAW,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IAEnB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,cAAc,CAAC,EAAE,GAAG,CAAC;IAErB,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC/B,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,WAAW,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAC9C,UAAU,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAE7C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtD"} |
| export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void; | ||
| export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string; | ||
| /** | ||
| * Checks if an event is supported in the current execution environment. | ||
| * @license Modernizr 3.0.0pre (Custom Build) | MIT | ||
| */ | ||
| export declare const isCoveredByReact: (eventNameSuffix: string, doc: Document) => boolean; | ||
| export declare const syncEvent: (node: Element & { | ||
| __events?: { | ||
| [key: string]: (e: Event) => any; | ||
| }; | ||
| }, eventName: string, newEventHandler?: (e: Event) => any) => void; | ||
| // # sourceMappingURL=attachProps.d.ts.map |
| {"version":3,"file":"attachProps.d.ts","sourceRoot":"","sources":["../../../src/react-component-lib/utils/attachProps.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,SAAU,WAAW,YAAY,GAAG,aAAY,GAAG,SAsC1E,CAAC;AAEF,eAAO,MAAM,YAAY,cAAe,YAAY,YAAY,GAAG,YAAY,GAAG,WAsBjF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,oBAAqB,MAAM,OAAO,QAAQ,YAWtE,CAAC;AAEF,eAAO,MAAM,SAAS;;2BAC+B,KAAK,KAAK,GAAG;;cACrD,MAAM,wBACK,KAAK,KAAK,GAAG,SAmBpC,CAAC"} |
| export declare const dashToPascalCase: (str: string) => string; | ||
| export declare const camelToDashCase: (str: string) => string; | ||
| // # sourceMappingURL=case.d.ts.map |
| {"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../../src/react-component-lib/utils/case.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,QAAS,MAAM,WAK/B,CAAC;AACd,eAAO,MAAM,eAAe,QAAS,MAAM,WACuB,CAAC"} |
| export declare const isDevMode: () => boolean; | ||
| export declare const deprecationWarning: (key: string, message: string) => void; | ||
| // # sourceMappingURL=dev.d.ts.map |
| {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/react-component-lib/utils/dev.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAErB,CAAC;AAIF,eAAO,MAAM,kBAAkB,QAAS,MAAM,WAAW,MAAM,SAO9D,CAAC"} |
+8
-14
@@ -6,10 +6,12 @@ # Change Log | ||
| ## [1.0.1](https://github.com/favware/syntax-highlighter/compare/v1.0.0...v1.0.1) (2020-08-06) | ||
| # [1.1.0](https://github.com/favware/syntax-highlighter/compare/v1.0.1...v1.1.0) (2021-01-26) | ||
| **Note:** Version bump only for package @favware/syntax-highlighter-react | ||
| ### Features | ||
| - expose clipboardJsError event & fix for latest StencilJS and PrismJS ([3c8cf80](https://github.com/favware/syntax-highlighter/commit/3c8cf8004abc8d07e55d66e6be1daa11303ffad9)) | ||
| ## [1.0.1](https://github.com/favware/syntax-highlighter/compare/v1.0.0...v1.0.1) (2020-08-06) | ||
| **Note:** Version bump only for package @favware/syntax-highlighter-react | ||
| # [1.0.0](https://github.com/favware/syntax-highlighter/compare/v0.1.0-alpha.3...v1.0.0) (2020-06-12) | ||
@@ -19,6 +21,2 @@ | ||
| # [0.1.0-alpha.2](https://github.com/favware/syntax-highlighter/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) (2020-06-11) | ||
@@ -28,6 +26,2 @@ | ||
| # [0.1.0-alpha.1](https://github.com/favware/syntax-highlighter/compare/v0.1.0-alpha.0...v0.1.0-alpha.1) (2020-06-11) | ||
@@ -37,7 +31,7 @@ | ||
| - **react:** fixed react build ([bab8808](https://github.com/favware/syntax-highlighter/commit/bab88081665b00db36ceb32c047fbc65c32e85e0)) | ||
| - **react:** fixed react build ([bab8808](https://github.com/favware/syntax-highlighter/commit/bab88081665b00db36ceb32c047fbc65c32e85e0)) | ||
| ### Features | ||
| - **core:** support TSX syntax ([fedd28c](https://github.com/favware/syntax-highlighter/commit/fedd28c41281d25ae78dbb92988f44525a3c46f2)) | ||
| - **core:** support TSX syntax ([fedd28c](https://github.com/favware/syntax-highlighter/commit/fedd28c41281d25ae78dbb92988f44525a3c46f2)) | ||
@@ -48,2 +42,2 @@ # 0.1.0-alpha.0 (2020-06-11) | ||
| - rewrite to mono repo ([a6b1a6c](https://github.com/favware/syntax-highlighter/commit/a6b1a6c63cf0770de2c95a324338597b3bfce6cd)) | ||
| - rewrite to mono repo ([a6b1a6c](https://github.com/favware/syntax-highlighter/commit/a6b1a6c63cf0770de2c95a324338597b3bfce6cd)) |
+4
-4
@@ -1,4 +0,4 @@ | ||
| /// <reference types="react" /> | ||
| import { JSX } from '@favware/syntax-highlighter-core'; | ||
| export declare const SyntaxHighlighter: import("react").ForwardRefExoticComponent<JSX.SyntaxHighlighter & import("react").HTMLAttributes<HTMLSyntaxHighlighterElement> & import("./react-component-lib/utils").ReactProps & import("react").RefAttributes<HTMLSyntaxHighlighterElement>>; | ||
| //# sourceMappingURL=index.d.ts.map | ||
| // / <reference types="react" /> | ||
| import type { JSX } from '@favware/syntax-highlighter-core'; | ||
| export declare const SyntaxHighlighter: import("react").ForwardRefExoticComponent<JSX.SyntaxHighlighter & Pick<import("react").HTMLAttributes<HTMLSyntaxHighlighterElement>, "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSyntaxHighlighterElement>>; | ||
| // # sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAKvD,eAAO,MAAM,iBAAiB,kPAA+G,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAK5D,eAAO,MAAM,iBAAiB,suJAA+G,CAAC"} |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import e from"react";import"react-dom";import{applyPolyfills as t,defineCustomElements as n}from"@favware/syntax-highlighter-core/loader";function r(e,t,n={}){const r=function(e,t,n){const r=o(e),s=o(t.className?t.className.split(" "):[]),a=o(n.className?n.className.split(" "):[]),c=[];return r.forEach(e=>{s.has(e)?(c.push(e),s.delete(e)):a.has(e)||c.push(e)}),s.forEach(e=>c.push(e)),c.join(" ")}(e.classList,t,n);r&&(e.className=r),Object.keys(t).forEach(n=>{if("children"!==n&&"style"!==n&&"ref"!==n&&"className"!==n)if(0===n.indexOf("on")&&n[2]===n[2].toUpperCase()){const r=n.substring(2),o=r[0].toLowerCase()+r.substring(1);s(o)||function(e,t,n){const r=e.__events||(e.__events={}),s=r[t];s&&e.removeEventListener(t,s);null!=n&&e.addEventListener(t,r[t]=function(e){n.call(this,e)})}(e,o,t[n])}else e[n]=t[n]})}function s(e,t=document){const n="on"+e;let r=n in t;if(!r){const e=t.createElement("div");e.setAttribute(n,"return;"),r="function"==typeof e[n]}return r}function o(e){const t=new Map;return e.forEach(e=>t.set(e,e)),t}const a=t=>{const n=t.toLowerCase().split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("");return((t,n)=>{const r=(n,r)=>e.createElement(t,Object.assign({},n,{forwardedRef:r}));return r.displayName=n,e.forwardRef(r)})(class extends e.Component{constructor(t){super(t),this.ref=e.createRef()}componentDidMount(){this.componentDidUpdate(this.props)}componentDidUpdate(e){r(this.ref.current,this.props,e)}render(){const n=this.props,{children:r,forwardedRef:o,style:a,className:c,ref:i}=n,f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(n,["children","forwardedRef","style","className","ref"]),l=Object.keys(f).reduce((e,t)=>{const n=0===t.indexOf("on")&&t[2]===t[2].toUpperCase(),r=0===t.indexOf("data-"),o=0===t.indexOf("aria-");if(n){const n=t.substring(2).toLowerCase();"undefined"!=typeof document&&s(n)&&(e[t]=f[t])}else(r||o)&&(e[t]=f[t]);return e},{}),p=Object.assign(Object.assign({},l),{ref:this.ref,style:a,className:c});return e.createElement(t,p,r)}static get displayName(){return n}},n)};t().then(()=>n());const c=a("syntax-highlighter");export{c as SyntaxHighlighter}; | ||
| import e from"react";import"react-dom";import{defineCustomElements as t}from"@favware/syntax-highlighter-core/loader";const n=(e,t,n)=>{const r=t.className||t.class,s=n.className||n.class,c=o(e),a=o(r?r.split(" "):[]),i=o(s?s.split(" "):[]),l=[];return c.forEach((e=>{a.has(e)?(l.push(e),a.delete(e)):i.has(e)||l.push(e)})),a.forEach((e=>l.push(e))),l.join(" ")},r=(e,t)=>{const n="on"+e;let r=n in t;if(!r){const e=t.createElement("div");e.setAttribute(n,"return;"),r="function"==typeof e[n]}return r},s=(e,t,n)=>{const r=e.__events||(e.__events={}),s=r[t];s&&e.removeEventListener(t,s),e.addEventListener(t,r[t]=function(e){n&&n.call(this,e)})},o=e=>{const t=new Map;return e.forEach((e=>t.set(e,e))),t},c=(...e)=>t=>e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})),a=(t,o,a)=>{const i=t.toLowerCase().split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("");const l=class extends e.Component{constructor(e){super(e),Object.defineProperty(this,"componentEl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"setComponentElRef",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.componentEl=e}})}componentDidMount(){this.componentDidUpdate(this.props)}componentDidUpdate(e){((e,t,o={})=>{if(e instanceof Element){const c=n(e.classList,t,o);""!==c&&(e.className=c),Object.keys(t).forEach((n=>{if("children"!==n&&"style"!==n&&"ref"!==n&&"class"!==n&&"className"!==n&&"forwardedRef"!==n)if(0===n.indexOf("on")&&n[2]===n[2].toUpperCase()){const o=n.substring(2),c=o[0].toLowerCase()+o.substring(1);"undefined"==typeof document||r(c,document)||s(e,c,t[n])}else e[n]=t[n],"string"==typeof t[n]?e.setAttribute(n.replace(/([A-Z])/g,(e=>`-${e[0].toLowerCase()}`)),t[n]):e[n]=t[n]}))}})(this.componentEl,this.props,e)}render(){const n=this.props,{children:s,forwardedRef:o,style:i,className:l,ref:p}=n,f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(n,["children","forwardedRef","style","className","ref"]);let d=Object.keys(f).reduce(((e,t)=>{if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){const n=t.substring(2).toLowerCase();"undefined"!=typeof document&&r(n,document)&&(e[t]=f[t])}else e[t]=f[t];return e}),{});a&&(d=a(this.props,d));let u=Object.assign(Object.assign({},d),{ref:c(o,this.setComponentElRef),style:i});return e.createElement(t,u,s)}static get displayName(){return i}};return o&&(l.contextType=o),((t,n)=>{const r=(n,r)=>e.createElement(t,Object.assign({},n,{forwardedRef:r}));return r.displayName=n,e.forwardRef(r)})(l,i)};t();const i=a("syntax-highlighter");export{i as SyntaxHighlighter}; | ||
| //# sourceMappingURL=index.es.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.es.js","sources":["../src/react-component-lib/utils/attachEventProps.ts","../src/react-component-lib/utils/index.tsx","../src/react-component-lib/createComponent.tsx","../src/index.ts"],"sourcesContent":["export function attachEventProps(node: HTMLElement, newProps: any, oldProps: any = {}) {\n const className = getClassName(node.classList, newProps, oldProps);\n if (className) {\n node.className = className;\n }\n\n Object.keys(newProps).forEach(name => {\n if (name === 'children' || name === 'style' || name === 'ref' || name === 'className') {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (!isCoveredByReact(eventNameLc)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n }\n });\n}\n\nexport function getClassName(classList: DOMTokenList, newProps: any, oldProps: any) {\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newProps.className ? newProps.className.split(' ') : []);\n const oldPropClasses = arrayToMap(oldProps.className ? oldProps.className.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach(currentClass => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach(s => finalClassNames.push(s));\n return finalClassNames.join(' ');\n}\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport function isCoveredByReact(eventNameSuffix: string, doc: Document = document) {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n}\n\nexport function syncEvent(node: Element, eventName: string, newEventHandler: (e: Event) => any) {\n const eventStore = (node as any).__events || ((node as any).__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n if (newEventHandler != null) {\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n newEventHandler.call(this, e);\n }),\n );\n }\n}\n\nfunction arrayToMap(arr: string[] | DOMTokenList) {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n}\n","import React from 'react';\n\nexport const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map(segment => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\n\nexport interface ReactProps {\n class?: string;\n}\n\nexport type IonicReactExternalProps<PropType, ElementType> = PropType & React.HTMLAttributes<ElementType> & ReactProps;\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: IonicReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachEventProps';\n","import React from 'react';\n\nimport {\n attachEventProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n} from './utils/index';\n\ninterface IonicReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef?: React.Ref<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <PropType, ElementType>(tagName: string) => {\n const displayName = dashToPascalCase(tagName);\n const ReactComponent = class extends React.Component<IonicReactInternalProps<ElementType>> {\n \n private ref: React.RefObject<HTMLElement>;\n \n constructor(props: IonicReactInternalProps<ElementType>) {\n super(props);\n this.ref = React.createRef<HTMLElement>();\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: IonicReactInternalProps<ElementType>) {\n const node = this.ref.current;\n attachEventProps(node, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n const propsToPass = Object.keys(cProps).reduce((acc, name) => {\n const isEventProp = name.indexOf('on') === 0 && name[2] === name[2].toUpperCase();\n const isDataProp = name.indexOf('data-') === 0;\n const isAriaProp = name.indexOf('aria-') === 0;\n\n if (isEventProp) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== \"undefined\" && isCoveredByReact(eventName)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else if (isDataProp || isAriaProp) {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n const newProps: any = {\n ...propsToPass,\n ref: this.ref,\n style,\n className,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport { JSX } from '@favware/syntax-highlighter-core';\n\nimport { defineCustomElements, applyPolyfills } from '@favware/syntax-highlighter-core/loader';\n\napplyPolyfills().then(() => defineCustomElements());\nexport const SyntaxHighlighter = /*@__PURE__*/createReactComponent<JSX.SyntaxHighlighter, HTMLSyntaxHighlighterElement>('syntax-highlighter');\n"],"names":["attachEventProps","node","newProps","oldProps","className","classList","currentClasses","arrayToMap","incomingPropClasses","split","oldPropClasses","finalClassNames","forEach","currentClass","has","push","delete","s","join","getClassName","Object","keys","name","indexOf","toUpperCase","eventName","substring","eventNameLc","toLowerCase","isCoveredByReact","newEventHandler","eventStore","__events","oldEventHandler","removeEventListener","addEventListener","e","call","this","syncEvent","eventNameSuffix","doc","document","isSupported","element","createElement","setAttribute","arr","map","Map","set","createReactComponent","tagName","displayName","segment","charAt","slice","ReactComponent","forwardRef","props","ref","React","forwardedRef","createForwardRef","Component","[object Object]","super","createRef","componentDidUpdate","prevProps","current","_a","children","style","cProps","propsToPass","reduce","acc","isEventProp","isDataProp","isAriaProp","applyPolyfills","then","defineCustomElements","SyntaxHighlighter"],"mappings":"mJAAgBA,EAAiBC,EAAmBC,EAAeC,EAAgB,IACjF,MAAMC,WAsBqBC,EAAyBH,EAAeC,GAEnE,MAAMG,EAAiBC,EAAWF,GAC5BG,EAAsBD,EAAWL,EAASE,UAAYF,EAASE,UAAUK,MAAM,KAAO,IACtFC,EAAiBH,EAAWJ,EAASC,UAAYD,EAASC,UAAUK,MAAM,KAAO,IACjFE,EAA4B,GAclC,OAXAL,EAAeM,QAAQC,IACjBL,EAAoBM,IAAID,IAE1BF,EAAgBI,KAAKF,GACrBL,EAAoBQ,OAAOH,IACjBH,EAAeI,IAAID,IAE7BF,EAAgBI,KAAKF,KAGzBL,EAAoBI,QAAQK,GAAKN,EAAgBI,KAAKE,IAC/CN,EAAgBO,KAAK,KAzCVC,CAAalB,EAAKI,UAAWH,EAAUC,GACrDC,IACFH,EAAKG,UAAYA,GAGnBgB,OAAOC,KAAKnB,GAAUU,QAAQU,IAC5B,GAAa,aAATA,GAAgC,UAATA,GAA6B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AAKsB,IAAMC,EAAMM,YAGnBF,oBACE3B,KAAK8B,mBAAmB9B,KAAKqB,OAG/BM,mBAAmBI,GAEjBrE,EADasC,KAAKsB,IAAIU,QACChC,KAAKqB,MAAOU,GAGrCJ,SACE,MAAMM,EAA+DjC,KAAKqB,OAApEa,SAAEA,EAAQV,aAAEA,EAAYW,MAAEA,EAAKrE,UAAEA,EAASwD,IAAEA,KAAQc,8UAApD,uDAEAC,EAAcvD,OAAOC,KAAKqD,GAAQE,OAAO,CAACC,EAAKvD,KACnD,MAAMwD,EAAqC,IAAvBxD,EAAKC,QAAQ,OAAeD,EAAK,KAAOA,EAAK,GAAGE,cAC9DuD,EAAuC,IAA1BzD,EAAKC,QAAQ,SAC1ByD,EAAuC,IAA1B1D,EAAKC,QAAQ,SAEhC,GAAIuD,EAAa,CACf,MAAMrD,EAAYH,EAAKI,UAAU,GAAGE,cACZ,oBAAbc,UAA4Bb,EAAiBJ,KACrDoD,EAAYvD,GAASoD,EAAepD,SAE9ByD,GAAcC,KACtBH,EAAYvD,GAASoD,EAAepD,IAEvC,OAAOuD,GACN,IAEG3E,iCACDyE,IACHf,IAAKtB,KAAKsB,IACVa,MAAAA,EACArE,UAAAA,IAGF,OAAOyD,EAAMhB,cAAcO,EAASlD,EAAUsE,GAGhDnB,yBACE,OAAOA,IAGoDA,IC1DjE4B,IAAiBC,KAAK,IAAMC,WACfC,EAAiCjC,EAA0E"} | ||
| {"version":3,"file":"index.es.js","sources":["../src/react-component-lib/utils/case.ts","../src/react-component-lib/utils/attachProps.ts","../src/react-component-lib/utils/index.tsx","../src/react-component-lib/createComponent.tsx","../src/index.ts"],"sourcesContent":["export const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str: string) =>\n str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n\n Object.keys(newProps).forEach((name) => {\n if (\n name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef'\n ) {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n } else {\n (node as any)[name] = newProps[name];\n }\n }\n });\n }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class;\n const oldClassProp: string = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n};\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any,\n) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }),\n );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n};\n","import React from 'react';\n\nimport type { StyleReactProps } from '../interfaces';\n\ntype Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?\n\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx\nexport const mergeRefs = <ElementType,>(...refs: React.Ref<ElementType>[]) => (\n value: ElementType,\n) =>\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // This is typed as readonly so we need to allow for override\n (ref as Mutable<React.RefObject<ElementType>>).current = value;\n }\n });\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React from 'react';\n\nimport {\n attachProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n mergeRefs,\n} from './utils';\n\nexport interface HTMLStencilElement extends HTMLElement {\n componentOnReady(): Promise<this>;\n}\n\ninterface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef: React.RefObject<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <\n PropType,\n ElementType extends HTMLStencilElement,\n ContextStateType = {},\n ExpandedPropsTypes = {}\n>(\n tagName: string,\n ReactComponentContext?: React.Context<ContextStateType>,\n manipulatePropsFunction?: (\n originalProps: StencilReactInternalProps<ElementType>,\n propsToPass: any,\n ) => ExpandedPropsTypes,\n) => {\n const displayName = dashToPascalCase(tagName);\n\n const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {\n componentEl!: ElementType;\n\n setComponentElRef = (element: ElementType) => {\n this.componentEl = element;\n };\n\n constructor(props: StencilReactInternalProps<ElementType>) {\n super(props);\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: StencilReactInternalProps<ElementType>) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport type { JSX } from '@favware/syntax-highlighter-core';\n\nimport { defineCustomElements } from '@favware/syntax-highlighter-core/loader';\n\ndefineCustomElements();\nexport const SyntaxHighlighter = /*@__PURE__*/createReactComponent<JSX.SyntaxHighlighter, HTMLSyntaxHighlighterElement>('syntax-highlighter');\n"],"names":["getClassName","classList","newProps","oldProps","newClassProp","className","class","oldClassProp","currentClasses","arrayToMap","incomingPropClasses","split","oldPropClasses","finalClassNames","forEach","currentClass","has","push","delete","s","join","isCoveredByReact","eventNameSuffix","doc","eventName","isSupported","element","createElement","setAttribute","syncEvent","node","newEventHandler","eventStore","__events","oldEventHandler","removeEventListener","addEventListener","e","call","this","arr","map","Map","set","mergeRefs","refs","value","ref","current","createReactComponent","tagName","ReactComponentContext","manipulatePropsFunction","displayName","toLowerCase","segment","charAt","toUpperCase","slice","ReactComponent","React","Component","[object Object]","props","super","Object","componentEl","componentDidUpdate","prevProps","Element","keys","name","indexOf","substring","eventNameLc","document","replace","m","attachProps","_a","children","forwardedRef","style","cProps","propsToPass","reduce","acc","setComponentElRef","contextType","forwardRef","createForwardRef","defineCustomElements","SyntaxHighlighter"],"mappings":"sHAAO,MC0CMA,EAAe,CAACC,EAAyBC,EAAeC,KACnE,MAAMC,EAAuBF,EAASG,WAAaH,EAASI,MACtDC,EAAuBJ,EAASE,WAAaF,EAASG,MAEtDE,EAAiBC,EAAWR,GAC5BS,EAAsBD,EAAWL,EAAeA,EAAaO,MAAM,KAAO,IAC1EC,EAAiBH,EAAWF,EAAeA,EAAaI,MAAM,KAAO,IACrEE,EAA4B,GAclC,OAXAL,EAAeM,SAASC,IAClBL,EAAoBM,IAAID,IAE1B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AClCL,MAAAA,IAGF,OAAOtB,EAAMjC,cAAcuB,EAAShD,EAAU8E,GAGhD3B,yBACE,OAAOA,IASX,OAJIF,IACFQ,EAAe6B,YAAcrC,GDjED,EAC9BQ,EACAN,KAEA,MAAMoC,EAAa,CACjB1B,EACAhB,IAEOa,gBAACD,mBAAmBI,GAAOkB,aAAclC,KAIlD,OAFA0C,EAAWpC,YAAcA,EAElBO,EAAM6B,WAAWA,ICwDjBC,CAAwC/B,EAAgBN,IClFjEsC,UACaC,EAAiC3C,EAA0E"} |
+1
-1
@@ -1,2 +0,2 @@ | ||
| "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e;require("react-dom");var r=require("@favware/syntax-highlighter-core/loader");function s(e,t,r={}){const s=function(e,t,r){const s=o(e),n=o(t.className?t.className.split(" "):[]),a=o(r.className?r.className.split(" "):[]),c=[];return s.forEach(e=>{n.has(e)?(c.push(e),n.delete(e)):a.has(e)||c.push(e)}),n.forEach(e=>c.push(e)),c.join(" ")}(e.classList,t,r);s&&(e.className=s),Object.keys(t).forEach(r=>{if("children"!==r&&"style"!==r&&"ref"!==r&&"className"!==r)if(0===r.indexOf("on")&&r[2]===r[2].toUpperCase()){const s=r.substring(2),o=s[0].toLowerCase()+s.substring(1);n(o)||function(e,t,r){const s=e.__events||(e.__events={}),n=s[t];n&&e.removeEventListener(t,n);null!=r&&e.addEventListener(t,s[t]=function(e){r.call(this,e)})}(e,o,t[r])}else e[r]=t[r]})}function n(e,t=document){const r="on"+e;let s=r in t;if(!s){const e=t.createElement("div");e.setAttribute(r,"return;"),s="function"==typeof e[r]}return s}function o(e){const t=new Map;return e.forEach(e=>t.set(e,e)),t}const a=e=>{const r=e.toLowerCase().split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("");return((e,r)=>{const s=(r,s)=>t.createElement(e,Object.assign({},r,{forwardedRef:s}));return s.displayName=r,t.forwardRef(s)})(class extends t.Component{constructor(e){super(e),this.ref=t.createRef()}componentDidMount(){this.componentDidUpdate(this.props)}componentDidUpdate(e){s(this.ref.current,this.props,e)}render(){const r=this.props,{children:s,forwardedRef:o,style:a,className:c,ref:i}=r,l=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(e);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(e,s[n])&&(r[s[n]]=e[s[n]])}return r}(r,["children","forwardedRef","style","className","ref"]),f=Object.keys(l).reduce((e,t)=>{const r=0===t.indexOf("on")&&t[2]===t[2].toUpperCase(),s=0===t.indexOf("data-"),o=0===t.indexOf("aria-");if(r){const r=t.substring(2).toLowerCase();"undefined"!=typeof document&&n(r)&&(e[t]=l[t])}else(s||o)&&(e[t]=l[t]);return e},{}),p=Object.assign(Object.assign({},f),{ref:this.ref,style:a,className:c});return t.createElement(e,p,s)}static get displayName(){return r}},r)};r.applyPolyfills().then(()=>r.defineCustomElements());const c=a("syntax-highlighter");exports.SyntaxHighlighter=c; | ||
| "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");require("react-dom");var t=require("@favware/syntax-highlighter-core/loader");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e);const s=(e,t,r)=>{const n=t.className||t.class,s=r.className||r.class,o=c(e),a=c(n?n.split(" "):[]),i=c(s?s.split(" "):[]),l=[];return o.forEach((e=>{a.has(e)?(l.push(e),a.delete(e)):i.has(e)||l.push(e)})),a.forEach((e=>l.push(e))),l.join(" ")},o=(e,t)=>{const r="on"+e;let n=r in t;if(!n){const e=t.createElement("div");e.setAttribute(r,"return;"),n="function"==typeof e[r]}return n},a=(e,t,r)=>{const n=e.__events||(e.__events={}),s=n[t];s&&e.removeEventListener(t,s),e.addEventListener(t,n[t]=function(e){r&&r.call(this,e)})},c=e=>{const t=new Map;return e.forEach((e=>t.set(e,e))),t},i=(...e)=>t=>e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})),l=(e,t,r)=>{const c=e.toLowerCase().split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("");const l=class extends n.default.Component{constructor(e){super(e),Object.defineProperty(this,"componentEl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"setComponentElRef",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.componentEl=e}})}componentDidMount(){this.componentDidUpdate(this.props)}componentDidUpdate(e){((e,t,r={})=>{if(e instanceof Element){const n=s(e.classList,t,r);""!==n&&(e.className=n),Object.keys(t).forEach((r=>{if("children"!==r&&"style"!==r&&"ref"!==r&&"class"!==r&&"className"!==r&&"forwardedRef"!==r)if(0===r.indexOf("on")&&r[2]===r[2].toUpperCase()){const n=r.substring(2),s=n[0].toLowerCase()+n.substring(1);"undefined"==typeof document||o(s,document)||a(e,s,t[r])}else e[r]=t[r],"string"==typeof t[r]?e.setAttribute(r.replace(/([A-Z])/g,(e=>`-${e[0].toLowerCase()}`)),t[r]):e[r]=t[r]}))}})(this.componentEl,this.props,e)}render(){const t=this.props,{children:s,forwardedRef:a,style:c,className:l,ref:f}=t,p=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}(t,["children","forwardedRef","style","className","ref"]);let u=Object.keys(p).reduce(((e,t)=>{if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){const r=t.substring(2).toLowerCase();"undefined"!=typeof document&&o(r,document)&&(e[t]=p[t])}else e[t]=p[t];return e}),{});r&&(u=r(this.props,u));let d=Object.assign(Object.assign({},u),{ref:i(a,this.setComponentElRef),style:c});return n.default.createElement(e,d,s)}static get displayName(){return c}};return t&&(l.contextType=t),((e,t)=>{const r=(t,r)=>n.default.createElement(e,Object.assign({},t,{forwardedRef:r}));return r.displayName=t,n.default.forwardRef(r)})(l,c)};t.defineCustomElements();const f=l("syntax-highlighter");exports.SyntaxHighlighter=f; | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sources":["../src/react-component-lib/utils/attachEventProps.ts","../src/react-component-lib/utils/index.tsx","../src/react-component-lib/createComponent.tsx","../src/index.ts"],"sourcesContent":["export function attachEventProps(node: HTMLElement, newProps: any, oldProps: any = {}) {\n const className = getClassName(node.classList, newProps, oldProps);\n if (className) {\n node.className = className;\n }\n\n Object.keys(newProps).forEach(name => {\n if (name === 'children' || name === 'style' || name === 'ref' || name === 'className') {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (!isCoveredByReact(eventNameLc)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n }\n });\n}\n\nexport function getClassName(classList: DOMTokenList, newProps: any, oldProps: any) {\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newProps.className ? newProps.className.split(' ') : []);\n const oldPropClasses = arrayToMap(oldProps.className ? oldProps.className.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach(currentClass => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach(s => finalClassNames.push(s));\n return finalClassNames.join(' ');\n}\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport function isCoveredByReact(eventNameSuffix: string, doc: Document = document) {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n}\n\nexport function syncEvent(node: Element, eventName: string, newEventHandler: (e: Event) => any) {\n const eventStore = (node as any).__events || ((node as any).__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n if (newEventHandler != null) {\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n newEventHandler.call(this, e);\n }),\n );\n }\n}\n\nfunction arrayToMap(arr: string[] | DOMTokenList) {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n}\n","import React from 'react';\n\nexport const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map(segment => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\n\nexport interface ReactProps {\n class?: string;\n}\n\nexport type IonicReactExternalProps<PropType, ElementType> = PropType & React.HTMLAttributes<ElementType> & ReactProps;\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: IonicReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachEventProps';\n","import React from 'react';\n\nimport {\n attachEventProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n} from './utils/index';\n\ninterface IonicReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef?: React.Ref<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <PropType, ElementType>(tagName: string) => {\n const displayName = dashToPascalCase(tagName);\n const ReactComponent = class extends React.Component<IonicReactInternalProps<ElementType>> {\n \n private ref: React.RefObject<HTMLElement>;\n \n constructor(props: IonicReactInternalProps<ElementType>) {\n super(props);\n this.ref = React.createRef<HTMLElement>();\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: IonicReactInternalProps<ElementType>) {\n const node = this.ref.current;\n attachEventProps(node, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n const propsToPass = Object.keys(cProps).reduce((acc, name) => {\n const isEventProp = name.indexOf('on') === 0 && name[2] === name[2].toUpperCase();\n const isDataProp = name.indexOf('data-') === 0;\n const isAriaProp = name.indexOf('aria-') === 0;\n\n if (isEventProp) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== \"undefined\" && isCoveredByReact(eventName)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else if (isDataProp || isAriaProp) {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n const newProps: any = {\n ...propsToPass,\n ref: this.ref,\n style,\n className,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport { JSX } from '@favware/syntax-highlighter-core';\n\nimport { defineCustomElements, applyPolyfills } from '@favware/syntax-highlighter-core/loader';\n\napplyPolyfills().then(() => defineCustomElements());\nexport const SyntaxHighlighter = /*@__PURE__*/createReactComponent<JSX.SyntaxHighlighter, HTMLSyntaxHighlighterElement>('syntax-highlighter');\n"],"names":["attachEventProps","node","newProps","oldProps","className","classList","currentClasses","arrayToMap","incomingPropClasses","split","oldPropClasses","finalClassNames","forEach","currentClass","has","push","delete","s","join","getClassName","Object","keys","name","indexOf","toUpperCase","eventName","substring","eventNameLc","toLowerCase","isCoveredByReact","newEventHandler","eventStore","__events","oldEventHandler","removeEventListener","addEventListener","e","call","this","syncEvent","eventNameSuffix","doc","document","isSupported","element","createElement","setAttribute","arr","map","Map","set","createReactComponent","tagName","displayName","segment","charAt","slice","ReactComponent","forwardRef","props","ref","React","forwardedRef","createForwardRef","Component","[object Object]","super","createRef","componentDidUpdate","prevProps","current","_a","children","style","cProps","propsToPass","reduce","acc","isEventProp","isDataProp","isAriaProp","applyPolyfills","then","defineCustomElements","SyntaxHighlighter"],"mappings":"uOAAgBA,EAAiBC,EAAmBC,EAAeC,EAAgB,IACjF,MAAMC,WAsBqBC,EAAyBH,EAAeC,GAEnE,MAAMG,EAAiBC,EAAWF,GAC5BG,EAAsBD,EAAWL,EAASE,UAAYF,EAASE,UAAUK,MAAM,KAAO,IACtFC,EAAiBH,EAAWJ,EAASC,UAAYD,EAASC,UAAUK,MAAM,KAAO,IACjFE,EAA4B,GAclC,OAXAL,EAAeM,QAAQC,IACjBL,EAAoBM,IAAID,IAE1BF,EAAgBI,KAAKF,GACrBL,EAAoBQ,OAAOH,IACjBH,EAAeI,IAAID,IAE7BF,EAAgBI,KAAKF,KAGzBL,EAAoBI,QAAQK,GAAKN,EAAgBI,KAAKE,IAC/CN,EAAgBO,KAAK,KAzCVC,CAAalB,EAAKI,UAAWH,EAAUC,GACrDC,IACFH,EAAKG,UAAYA,GAGnBgB,OAAOC,KAAKnB,GAAUU,QAAQU,IAC5B,GAAa,aAATA,GAAgC,UAATA,GAA6B,QAATA,GAA2B,cAATA,EAGjE,GAA2B,IAAvBA,EAAKC,QAAQ,OAAeD,EAAK,KAAOA,EAAK,GAAGE,cAAe,CACjE,MAAMC,EAAYH,EAAKI,UAAU,GAC3BC,EAAcF,EAAU,GAAGG,cAAgBH,EAAUC,UAAU,GAEhEG,EAAiBF,aAgDF1B,EAAewB,EAAmBK,GAC1D,MAAMC,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ASwD,IAAEA,KAAQc,8UAApD,uDAEAC,EAAcvD,OAAOC,KAAKqD,GAAQE,OAAO,CAACC,EAAKvD,KACnD,MAAMwD,EAAqC,IAAvBxD,EAAKC,QAAQ,OAAeD,EAAK,KAAOA,EAAK,GAAGE,cAC9DuD,EAAuC,IAA1BzD,EAAKC,QAAQ,SAC1ByD,EAAuC,IAA1B1D,EAAKC,QAAQ,SAEhC,GAAIuD,EAAa,CACf,MAAMrD,EAAYH,EAAKI,UAAU,GAAGE,cACZ,oBAAbc,UAA4Bb,EAAiBJ,KACrDoD,EAAYvD,GAASoD,EAAepD,SAE9ByD,GAAcC,KACtBH,EAAYvD,GAASoD,EAAepD,IAEvC,OAAOuD,GACN,IAEG3E,iCACDyE,IACHf,IAAKtB,KAAKsB,IACVa,MAAAA,EACArE,UAAAA,IAGF,OAAOyD,EAAMhB,cAAcO,EAASlD,EAAUsE,GAGhDnB,yBACE,OAAOA,IAGoDA,IC1DjE4B,mBAAiBC,KAAK,IAAMC,gCACfC,EAAiCjC,EAA0E"} | ||
| {"version":3,"file":"index.js","sources":["../src/react-component-lib/utils/case.ts","../src/react-component-lib/utils/attachProps.ts","../src/react-component-lib/utils/index.tsx","../src/react-component-lib/createComponent.tsx","../src/index.ts"],"sourcesContent":["export const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str: string) =>\n str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n\n Object.keys(newProps).forEach((name) => {\n if (\n name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef'\n ) {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n } else {\n (node as any)[name] = newProps[name];\n }\n }\n });\n }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class;\n const oldClassProp: string = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n};\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any,\n) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }),\n );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n};\n","import React from 'react';\n\nimport type { StyleReactProps } from '../interfaces';\n\ntype Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?\n\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx\nexport const mergeRefs = <ElementType,>(...refs: React.Ref<ElementType>[]) => (\n value: ElementType,\n) =>\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // This is typed as readonly so we need to allow for override\n (ref as Mutable<React.RefObject<ElementType>>).current = value;\n }\n });\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React from 'react';\n\nimport {\n attachProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n mergeRefs,\n} from './utils';\n\nexport interface HTMLStencilElement extends HTMLElement {\n componentOnReady(): Promise<this>;\n}\n\ninterface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef: React.RefObject<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <\n PropType,\n ElementType extends HTMLStencilElement,\n ContextStateType = {},\n ExpandedPropsTypes = {}\n>(\n tagName: string,\n ReactComponentContext?: React.Context<ContextStateType>,\n manipulatePropsFunction?: (\n originalProps: StencilReactInternalProps<ElementType>,\n propsToPass: any,\n ) => ExpandedPropsTypes,\n) => {\n const displayName = dashToPascalCase(tagName);\n\n const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {\n componentEl!: ElementType;\n\n setComponentElRef = (element: ElementType) => {\n this.componentEl = element;\n };\n\n constructor(props: StencilReactInternalProps<ElementType>) {\n super(props);\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: StencilReactInternalProps<ElementType>) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport type { JSX } from '@favware/syntax-highlighter-core';\n\nimport { defineCustomElements } from '@favware/syntax-highlighter-core/loader';\n\ndefineCustomElements();\nexport const SyntaxHighlighter = /*@__PURE__*/createReactComponent<JSX.SyntaxHighlighter, HTMLSyntaxHighlighterElement>('syntax-highlighter');\n"],"names":["getClassName","classList","newProps","oldProps","newClassProp","className","class","oldClassProp","currentClasses","arrayToMap","incomingPropClasses","split","oldPropClasses","finalClassNames","forEach","currentClass","has","push","delete","s","join","isCoveredByReact","eventNameSuffix","doc","eventName","isSupported","element","createElement","setAttribute","syncEvent","node","newEventHandler","eventStore","__events","oldEventHandler","removeEventListener","addEventListener","e","call","this","arr","map","Map","set","mergeRefs","refs","value","ref","current","createReactComponent","tagName","ReactComponentContext","manipulatePropsFunction","displayName","toLowerCase","segment","charAt","toUpperCase","slice","ReactComponent","React","Component","[object Object]","props","super","Object","componentEl","componentDidUpdate","prevProps","Element","keys","name","indexOf","substring","eventNameLc","document","replace","m","attachProps","_a","children","forwardedRef","style","cProps","propsToPass","reduce","acc","setComponentElRef","contextType","forwardRef","createForwardRef","defineCustomElements","SyntaxHighlighter"],"mappings":"4PAAO,MC0CMA,EAAe,CAACC,EAAyBC,EAAeC,KACnE,MAAMC,EAAuBF,EAASG,WAAaH,EAASI,MACtDC,EAAuBJ,EAASE,WAAaF,EAASG,MAEtDE,EAAiBC,EAAWR,GAC5BS,EAAsBD,EAAWL,EAAeA,EAAaO,MAAM,KAAO,IAC1EC,EAAiBH,EAAWF,EAAeA,EAAaI,MAAM,KAAO,IACrEE,EAA4B,GAclC,OAXAL,EAAeM,SAASC,IAClBL,EAAoBM,IAAID,IAE1BF,EAAgBI,KAAKF,GACrBL,EAAoBQ,OAAOH,IACjBH,EAAeI,IAAID,IAE7BF,EAAgBI,KAAKF,MAGzBL,EAAoBI,SAASK,GAAMN,EAAgBI,KAAKE,KACjDN,EAAgBO,KAAK,MAOjBC,EAAmB,CAACC,EAAyBC,KACxD,MAAMC,EAAY,KAAOF,EACzB,IAAIG,EAAcD,KAAaD,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C,YAAcA,EAElBO,UAAM6B,WAAWA,ICwDjBC,CAAwC/B,EAAgBN,IClFjEsC,+BACaC,EAAiC3C,EAA0E"} |
| import React from 'react'; | ||
| export declare const createReactComponent: <PropType, ElementType>(tagName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").IonicReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>; | ||
| //# sourceMappingURL=createComponent.d.ts.map | ||
| export interface HTMLStencilElement extends HTMLElement { | ||
| componentOnReady(): Promise<this>; | ||
| } | ||
| interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> { | ||
| forwardedRef: React.RefObject<ElementType>; | ||
| ref?: React.Ref<any>; | ||
| } | ||
| export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType>, manipulatePropsFunction?: (originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>; | ||
| export {}; | ||
| // # sourceMappingURL=createComponent.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/react-component-lib/createComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,eAAO,MAAM,oBAAoB,mCAAoC,MAAM,gKAsD1E,CAAC"} | ||
| {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../../src/react-component-lib/createComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,UAAU,yBAAyB,CAAC,WAAW,CAAE,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACxF,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACtB;AAED,eAAO,MAAM,oBAAoB,8GAMtB,MAAM,0JAIA,GAAG,yLA+DnB,CAAC"} |
@@ -0,46 +1,21 @@ | ||
| import { OverlayEventDetail } from './interfaces'; | ||
| import React from 'react'; | ||
| interface LoadingElement { | ||
| present: () => any; | ||
| dismiss: () => any; | ||
| interface OverlayElement extends HTMLElement { | ||
| present: () => Promise<void>; | ||
| dismiss: (data?: any, role?: string | undefined) => Promise<boolean>; | ||
| } | ||
| interface ReactOverlayProps<E> { | ||
| export interface ReactOverlayProps { | ||
| children?: React.ReactNode; | ||
| isOpen: boolean; | ||
| onDidDismiss?: (event: CustomEvent<E>) => void; | ||
| onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void; | ||
| onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void; | ||
| onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void; | ||
| onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void; | ||
| } | ||
| export declare function createOverlayComponent<T extends object, LoadingElementType extends LoadingElement, OverlayEventDetail>(displayName: string, controller: { | ||
| create: (options: any) => Promise<LoadingElementType>; | ||
| }): { | ||
| new (props: T & ReactOverlayProps<OverlayEventDetail>): { | ||
| controller?: LoadingElementType; | ||
| el: HTMLDivElement; | ||
| componentDidMount(): void; | ||
| componentDidUpdate(prevProps: T & ReactOverlayProps<OverlayEventDetail>): Promise<void>; | ||
| present(prevProps?: T & ReactOverlayProps<OverlayEventDetail>): Promise<void>; | ||
| render(): React.ReactPortal; | ||
| context: any; | ||
| setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<T & ReactOverlayProps<OverlayEventDetail>>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void; | ||
| forceUpdate(callback?: () => void): void; | ||
| readonly props: Readonly<T & ReactOverlayProps<OverlayEventDetail>> & Readonly<{ | ||
| children?: React.ReactNode; | ||
| }>; | ||
| state: Readonly<{}>; | ||
| refs: { | ||
| [key: string]: React.ReactInstance; | ||
| }; | ||
| shouldComponentUpdate?(nextProps: Readonly<T & ReactOverlayProps<OverlayEventDetail>>, nextState: Readonly<{}>, nextContext: any): boolean; | ||
| componentWillUnmount?(): void; | ||
| componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; | ||
| getSnapshotBeforeUpdate?(prevProps: Readonly<T & ReactOverlayProps<OverlayEventDetail>>, prevState: Readonly<{}>): any; | ||
| componentWillMount?(): void; | ||
| UNSAFE_componentWillMount?(): void; | ||
| componentWillReceiveProps?(nextProps: Readonly<T & ReactOverlayProps<OverlayEventDetail>>, nextContext: any): void; | ||
| UNSAFE_componentWillReceiveProps?(nextProps: Readonly<T & ReactOverlayProps<OverlayEventDetail>>, nextContext: any): void; | ||
| componentWillUpdate?(nextProps: Readonly<T & ReactOverlayProps<OverlayEventDetail>>, nextState: Readonly<{}>, nextContext: any): void; | ||
| UNSAFE_componentWillUpdate?(nextProps: Readonly<T & ReactOverlayProps<OverlayEventDetail>>, nextState: Readonly<{}>, nextContext: any): void; | ||
| }; | ||
| readonly displayName: string; | ||
| contextType?: React.Context<any>; | ||
| }; | ||
| export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(displayName: string, controller: { | ||
| create: (options: any) => Promise<OverlayType>; | ||
| }) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & { | ||
| forwardedRef?: React.RefObject<OverlayType>; | ||
| }> & React.RefAttributes<OverlayType>>; | ||
| export {}; | ||
| //# sourceMappingURL=createOverlayComponent.d.ts.map | ||
| // # sourceMappingURL=createOverlayComponent.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"createOverlayComponent.d.ts","sourceRoot":"","sources":["../src/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,GAAG,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,CAAC;CACpB;AACD,UAAU,iBAAiB,CAAC,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAChD;AAED,wBAAgB,sBAAsB,CACpC,CAAC,SAAS,MAAM,EAChB,kBAAkB,SAAS,cAAc,EACzC,kBAAkB,EAClB,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE;IAAE,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAAE;;qBAM3E,kBAAkB;YAC3B,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDrB"} | ||
| {"version":3,"file":"createOverlayComponent.d.ts","sourceRoot":"","sources":["../../src/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,cAAe,SAAQ,WAAW;IAC1C,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACtE;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IAChE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IAChE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACjE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;CAClE;AAED,eAAO,MAAM,sBAAsB,qFAIpB,MAAM;sBACa,GAAG;;;sCAyGpC,CAAC"} |
| export { createReactComponent } from './createComponent'; | ||
| export { createControllerComponent } from './createControllerComponent'; | ||
| export { createOverlayComponent } from './createOverlayComponent'; | ||
| //# sourceMappingURL=index.d.ts.map | ||
| // # sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/react-component-lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-component-lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"} |
| import React from 'react'; | ||
| export declare const dashToPascalCase: (str: string) => string; | ||
| export interface ReactProps { | ||
| class?: string; | ||
| } | ||
| export declare type IonicReactExternalProps<PropType, ElementType> = PropType & React.HTMLAttributes<ElementType> & ReactProps; | ||
| export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<IonicReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>; | ||
| export * from './attachEventProps'; | ||
| //# sourceMappingURL=index.d.ts.map | ||
| import type { StyleReactProps } from '../interfaces'; | ||
| export declare type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps; | ||
| export declare const mergeRefs: <ElementType>(...refs: React.Ref<ElementType>[]) => (value: ElementType) => void; | ||
| export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>; | ||
| export * from './attachProps'; | ||
| export * from './case'; | ||
| // # sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-component-lib/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,gBAAgB,QAAS,MAAM,WAK/B,CAAC;AAEd,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,oBAAY,uBAAuB,CAAC,QAAQ,EAAE,WAAW,IAAI,QAAQ,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC;AAEvH,eAAO,MAAM,gBAAgB,0CACX,GAAG,eACN,MAAM,8IAWpB,CAAC;AAEF,cAAc,oBAAoB,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react-component-lib/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,oBAAY,yBAAyB,CAAC,QAAQ,EAAE,WAAW,IAAI,QAAQ,GACrE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAChD,eAAe,CAAC;AAGlB,eAAO,MAAM,SAAS,kFAUlB,CAAC;AAEL,eAAO,MAAM,gBAAgB,0CACX,GAAG,eACN,MAAM,gJAWpB,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC"} |
+2
-3
@@ -1,3 +0,2 @@ | ||
| The MIT License (MIT) | ||
| ===================== | ||
| # The MIT License (MIT) | ||
@@ -25,2 +24,2 @@ Copyright © 2018 | ||
| FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| OTHER DEALINGS IN THE SOFTWARE. | ||
| OTHER DEALINGS IN THE SOFTWARE. |
+51
-60
| { | ||
| "name": "@favware/syntax-highlighter-react", | ||
| "version": "1.0.1", | ||
| "description": "React bindings for @favware/syntax-highlighter-core", | ||
| "author": "@favware", | ||
| "license": "MIT", | ||
| "main": "dist/index.js", | ||
| "module": "dist/index.es.js", | ||
| "typings": "dist/index.d.ts", | ||
| "homepage": "https://github.com/favware/syntax-highlighter/tree/main/packages/react#readme", | ||
| "scripts": { | ||
| "build": "rollup -c rollup.config.ts" | ||
| }, | ||
| "devDependencies": { | ||
| "@rollup/plugin-commonjs": "^13.0.0", | ||
| "@rollup/plugin-node-resolve": "^8.1.0", | ||
| "rollup": "^2.18.0", | ||
| "rollup-plugin-cleaner": "^1.0.0", | ||
| "rollup-plugin-peer-deps-external": "^2.2.2", | ||
| "rollup-plugin-terser": "^6.1.0", | ||
| "rollup-plugin-typescript2": "^0.27.1" | ||
| }, | ||
| "peerDependencies": { | ||
| "@favware/syntax-highlighter-core": "latest", | ||
| "react": "^16.x", | ||
| "react-dom": "^16.x" | ||
| }, | ||
| "directories": { | ||
| "lib": "src" | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "engines": { | ||
| "node": ">=10" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/favware/syntax-highlighter.git" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/favware/syntax-highlighter/issues" | ||
| }, | ||
| "keywords": [ | ||
| "favware", | ||
| "typescript", | ||
| "ts", | ||
| "yarn", | ||
| "stenciljs", | ||
| "syntax", | ||
| "highlight", | ||
| "prism", | ||
| "primsjs", | ||
| "react", | ||
| "webcomponents", | ||
| "stencil" | ||
| ], | ||
| "gitHead": "6e6bf2c0317194a16a7a5a1ac8e695974b8a59c7" | ||
| "name": "@favware/syntax-highlighter-react", | ||
| "version": "1.1.0", | ||
| "description": "React bindings for @favware/syntax-highlighter-core", | ||
| "author": "@favware", | ||
| "license": "MIT", | ||
| "main": "dist/index.js", | ||
| "module": "dist/index.es.js", | ||
| "typings": "dist/index.d.ts", | ||
| "homepage": "https://github.com/favware/syntax-highlighter/tree/main/packages/react#readme", | ||
| "scripts": { | ||
| "build": "rollup -c rollup.config.ts" | ||
| }, | ||
| "peerDependencies": { | ||
| "@favware/syntax-highlighter-core": "latest", | ||
| "react": "^16.8.x || ^17.x", | ||
| "react-dom": "^16.8.x || ^17.x" | ||
| }, | ||
| "directories": { | ||
| "lib": "src" | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "engines": { | ||
| "node": ">=10" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/favware/syntax-highlighter.git" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/favware/syntax-highlighter/issues" | ||
| }, | ||
| "keywords": [ | ||
| "favware", | ||
| "typescript", | ||
| "ts", | ||
| "yarn", | ||
| "stenciljs", | ||
| "syntax", | ||
| "highlight", | ||
| "prism", | ||
| "primsjs", | ||
| "react", | ||
| "webcomponents", | ||
| "stencil" | ||
| ], | ||
| "gitHead": "592f15f08e2210ed1e3096e5ba3ef7ec33578f88" | ||
| } |
+41
-58
| <div align="center"> | ||
| <p> | ||
| <a href="https://favware.tech/syntaxhighlighter"><img style="height: 200px" src="https://cdn.favware.tech/img/syntax-highlighter.png" height="200" alt="logo"/></a> | ||
| </p> | ||
| <p> | ||
| <h1> @favware/syntax-highlighter-react </h1> | ||
| <h3> React bindings for favware/syntax-highlighter-core </h3> | ||
| </p> | ||
| <p> | ||
| <a href="https://github.com/favware/syntax-highlighter/blob/main/LICENSE.md"> | ||
| <img src="https://img.shields.io/github/license/favware/syntax-highlighter?logo=github&maxAge=3600&style=flat-square" alt="NPM version" /> | ||
| </a> | ||
| </p> | ||
| <p> | ||
| <a href="https://www.npmjs.com/package/@favware/syntax-highlighter-react"> | ||
| <img src="https://img.shields.io/npm/v/@favware/syntax-highlighter-react.svg?maxAge=3600&logo=npm&style=flat-square" alt="NPM version" /> | ||
| </a> | ||
| <a href="https://www.npmjs.com/package/@favware/syntax-highlighter-react"> | ||
| <img src="https://img.shields.io/npm/dt/@favware/syntax-highlighter-react.svg?maxAge=3600&logo=npm&style=flat-square" alt="NPM downloads" /> | ||
| </a> | ||
| </p> | ||
| <p> | ||
| <a href="https://bundlephobia.com/result?p=@favware/syntax-highlighter-react"> | ||
| <img src="https://img.shields.io/bundlephobia/min/@favware/syntax-highlighter-react?label=minified&logo=webpack&maxAge=3600&style=flat-square" alt="Minified Size"> | ||
| </a> | ||
| # @favware/syntax-highlighter-react | ||
| <a href="https://bundlephobia.com/result?p=@favware/syntax-highlighter-react"> | ||
| <img src="https://img.shields.io/bundlephobia/minzip/@favware/syntax-highlighter-react?label=minzipped&logo=webpack&maxAge=3600&style=flat-square" alt="Minzipped Size"> | ||
| </a> | ||
| </p> | ||
| **A lightweight, easy-to-use and framework agnostic syntax highlighter for your code examples(snippets) in web applications** | ||
| <a href="https://depfu.com/github/favware/syntax-highlighter?project_id=13651"> | ||
| <img src="https://badges.depfu.com/badges/4853d088999fc77ee0f8377b3fb52d9a/count.svg" alt="Depfu" /> | ||
| </a> | ||
| [](https://github.com/favware/syntax-highlighter/blob/main/LICENSE.md) | ||
| [](https://www.npmjs.com/package/@favware/syntax-highlighter-react) | ||
| [](https://www.npmjs.com/package/@favware/syntax-highlighter-react) | ||
| [](https://bundlephobia.com/result?p=@favware/syntax-highlighter-react) | ||
| [](https://depfu.com/github/favware/syntax-highlighter?project_id=21396) | ||
| [](https://stenciljs.com) | ||
| <a href="https://donate.favware.tech/patreon"> | ||
| <img src="https://img.shields.io/badge/donate-patreon-F96854.svg?logo=patreon" alt="Patreon" /> | ||
| </a> | ||
| <a href="https://stenciljs.com/"> | ||
| <img src="https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square" Alt="Stencil" /> | ||
| </a> | ||
| </div> | ||
@@ -50,33 +20,36 @@ | ||
| - [Why yet another code highlighter?](#why-yet-another-code-highlighter) | ||
| - [Features](#features) | ||
| - [Installation](#installation) | ||
| - [Usage](#usage) | ||
| - [Supported Languages](#supported-languages) | ||
| - [Why yet another code highlighter?](#why-yet-another-code-highlighter) | ||
| - [Features](#features) | ||
| - [Installation](#installation) | ||
| - [Usage](#usage) | ||
| - [Supported Languages](#supported-languages) | ||
| - [Screenshots](#screenshots) | ||
| - [Dark Mode](#dark-mode) | ||
| - [Light Mode](#light-mode) | ||
| # Why yet another code highlighter? | ||
| ## Why yet another code highlighter? | ||
| > There are many syntax highlighters avaliable already but most of those are either complex to setup or front end framework specific. `@favware/syntax-highlighter-core` is built using StencilJS. You can use it everywhere, i.e. Angular, React, Vue, any framework, No Framework! | ||
| > There are many syntax highlighters avaliable already but most of those are either complex to setup or front end framework specific. `@favware/syntax-highlighter-react` is built using StencilJS. You can use it everywhere, i.e. Angular, React, Vue, any framework, No Framework! | ||
| > | ||
| > **This is an adoptation of [snippet-highlight] from [rahulbhooteshwar]** | ||
| # Features | ||
| ## Features | ||
| - Uses [PrismJS] for syntax highlighting | ||
| - Light and Dark mode supported | ||
| - Copy code support | ||
| - Supports many languages, see [Supported Languages](#supported-languages) | ||
| - Will default to using [Fira Code] as font family | ||
| - The library first falls back to popular fonts such as [Cascadia Code] and [Meslo NGF] if it isn't available. If these are also not available it will go through various more popular coding fonts, ending in `monospace` | ||
| - Uses [PrismJS] for syntax highlighting | ||
| - Light and Dark mode supported | ||
| - Copy code support | ||
| - Supports many languages, see [Supported Languages](#supported-languages) | ||
| - Will default to using [Fira Code][] as font family | ||
| - The library first falls back to popular fonts such as [Cascadia Code][] and [Meslo NGF][] if it isn't available. If these are also not available it will go through various more popular coding fonts, ending in `monospace` | ||
| # Installation | ||
| ## Installation | ||
| ```bash | ||
| yarn add @favware/syntax-highlighter-core @favware/syntax-highlighter-react | ||
| # or npm install @favware/syntax-highlighter-core @favware/syntax-highlighter-react | ||
| yarn add @favware/syntax-highlighter-react @favware/syntax-highlighter-react | ||
| # or npm install @favware/syntax-highlighter-react @favware/syntax-highlighter-react | ||
| ``` | ||
| ## Usage | ||
| ### Usage | ||
| [Sample on CodeSanbox](https://codesandbox.io/s/syntax-highlighter-react-bb90c) | ||
| [](https://codesandbox.io/s/syntax-highlighter-react-bb90c) | ||
@@ -91,3 +64,3 @@ The syntax is kept fairly simple. Here's a basic example of some simple JavaScript code: | ||
| # Supported Languages | ||
| ## Supported Languages | ||
@@ -108,2 +81,12 @@ To limit the size of this library a selection has been made from all langauges supported by PrismJS. The chosen languages are those that we consider the most popular / common. If you want to see another languages supported you're always free to open [an issue] | ||
| ## Screenshots | ||
| ### Dark Mode | ||
|  | ||
| ### Light Mode | ||
|  | ||
| <!-- LINK DUMP --> | ||
@@ -110,0 +93,0 @@ |
| import React from 'react'; | ||
| interface LoadingElement { | ||
| present: () => any; | ||
| dismiss: () => any; | ||
| } | ||
| interface ReactControllerProps<E> { | ||
| isOpen: boolean; | ||
| onDidDismiss: (event: CustomEvent<E>) => void; | ||
| } | ||
| export declare function createControllerComponent<OptionsType extends object, LoadingElementType extends LoadingElement, OverlayEventDetail>(displayName: string, controller: { | ||
| create: (options: any) => Promise<LoadingElementType>; | ||
| }): { | ||
| new (props: OptionsType & ReactControllerProps<OverlayEventDetail>): { | ||
| controller?: LoadingElementType; | ||
| componentDidMount(): Promise<void>; | ||
| componentDidUpdate(prevProps: OptionsType & ReactControllerProps<OverlayEventDetail>): Promise<void>; | ||
| present(prevProps?: OptionsType & ReactControllerProps<OverlayEventDetail>): Promise<void>; | ||
| render(): null; | ||
| context: any; | ||
| setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void; | ||
| forceUpdate(callback?: () => void): void; | ||
| readonly props: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>> & Readonly<{ | ||
| children?: React.ReactNode; | ||
| }>; | ||
| state: Readonly<{}>; | ||
| refs: { | ||
| [key: string]: React.ReactInstance; | ||
| }; | ||
| shouldComponentUpdate?(nextProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, nextState: Readonly<{}>, nextContext: any): boolean; | ||
| componentWillUnmount?(): void; | ||
| componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; | ||
| getSnapshotBeforeUpdate?(prevProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, prevState: Readonly<{}>): any; | ||
| componentWillMount?(): void; | ||
| UNSAFE_componentWillMount?(): void; | ||
| componentWillReceiveProps?(nextProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, nextContext: any): void; | ||
| UNSAFE_componentWillReceiveProps?(nextProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, nextContext: any): void; | ||
| componentWillUpdate?(nextProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, nextState: Readonly<{}>, nextContext: any): void; | ||
| UNSAFE_componentWillUpdate?(nextProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, nextState: Readonly<{}>, nextContext: any): void; | ||
| }; | ||
| readonly displayName: string; | ||
| contextType?: React.Context<any>; | ||
| }; | ||
| export {}; | ||
| //# sourceMappingURL=createControllerComponent.d.ts.map |
| {"version":3,"file":"createControllerComponent.d.ts","sourceRoot":"","sources":["../src/react-component-lib/createControllerComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,GAAG,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,CAAC;CACpB;AAED,UAAU,oBAAoB,CAAC,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAC/C;AAED,wBAAgB,yBAAyB,CACvC,WAAW,SAAS,MAAM,EAC1B,kBAAkB,SAAS,cAAc,EACzC,kBAAkB,EAClB,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE;IAAE,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAAE;;qBAM3E,kBAAkB;;;;kBA2CrB,IAAI;;;;;;;;;;;;;;;;;;;;;;;;EAIjB"} |
| export declare function attachEventProps(node: HTMLElement, newProps: any, oldProps?: any): void; | ||
| export declare function getClassName(classList: DOMTokenList, newProps: any, oldProps: any): string; | ||
| /** | ||
| * Checks if an event is supported in the current execution environment. | ||
| * @license Modernizr 3.0.0pre (Custom Build) | MIT | ||
| */ | ||
| export declare function isCoveredByReact(eventNameSuffix: string, doc?: Document): boolean; | ||
| export declare function syncEvent(node: Element, eventName: string, newEventHandler: (e: Event) => any): void; | ||
| //# sourceMappingURL=attachEventProps.d.ts.map |
| {"version":3,"file":"attachEventProps.d.ts","sourceRoot":"","sources":["../../src/react-component-lib/utils/attachEventProps.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAE,GAAQ,QAqBpF;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,UAoBjF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,GAAE,QAAmB,WAWjF;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,GAAG,QAkB7F"} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
55086
20.87%0
-100%26
18.18%130
-3.7%98
-14.78%1
Infinity%