@aquera/nile-elements 0.0.31 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +4 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +4 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb/nile-breadcrumb.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb/nile-breadcrumb.css.js +18 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb/nile-breadcrumb.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb/nile-breadcrumb.d.ts +35 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb/nile-breadcrumb.js +61 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb/nile-breadcrumb.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb-item/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb-item/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb-item/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.css.js +47 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.d.ts +34 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js +74 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/nile-card.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/nile-card.css.js +71 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/nile-card.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/nile-card.d.ts +26 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/nile-card.js +46 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/nile-card.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/extensionSetup.d.ts +33 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/extensionSetup.js +63 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/extensionSetup.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js +42 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.d.ts +43 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +114 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/arrowright.d.ts +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/arrowright.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/arrowright.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.d.ts +2 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js +9 -6
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +11 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +11 -5
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +55 -7
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.css.js +7 -15
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.js +21 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.js +4 -4
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tooltip/nile-tooltip.css.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tooltip/nile-tooltip.js +2 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +545 -374
- package/dist/nile-breadcrumb/index.cjs.js +2 -0
- package/dist/nile-breadcrumb/index.cjs.js.map +1 -0
- package/dist/nile-breadcrumb/index.esm.js +1 -0
- package/dist/nile-breadcrumb/nile-breadcrumb.cjs.js +2 -0
- package/dist/nile-breadcrumb/nile-breadcrumb.cjs.js.map +1 -0
- package/dist/nile-breadcrumb/nile-breadcrumb.css.cjs.js +2 -0
- package/dist/nile-breadcrumb/nile-breadcrumb.css.cjs.js.map +1 -0
- package/dist/nile-breadcrumb/nile-breadcrumb.css.esm.js +6 -0
- package/dist/nile-breadcrumb/nile-breadcrumb.esm.js +6 -0
- package/dist/nile-breadcrumb-item/index.cjs.js +2 -0
- package/dist/nile-breadcrumb-item/index.cjs.js.map +1 -0
- package/dist/nile-breadcrumb-item/index.esm.js +1 -0
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js +2 -0
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js.map +1 -0
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.css.cjs.js +2 -0
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.css.cjs.js.map +1 -0
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.css.esm.js +35 -0
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.esm.js +13 -0
- package/dist/nile-card/index.cjs.js +2 -0
- package/dist/nile-card/index.cjs.js.map +1 -0
- package/dist/nile-card/index.esm.js +1 -0
- package/dist/nile-card/nile-card.cjs.js +2 -0
- package/dist/nile-card/nile-card.cjs.js.map +1 -0
- package/dist/nile-card/nile-card.css.cjs.js +2 -0
- package/dist/nile-card/nile-card.css.cjs.js.map +1 -0
- package/dist/nile-card/nile-card.css.esm.js +59 -0
- package/dist/nile-card/nile-card.esm.js +9 -0
- package/dist/nile-code-editor/extensionSetup.cjs.js +7 -0
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -0
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -0
- package/dist/nile-code-editor/index.cjs.js +2 -0
- package/dist/nile-code-editor/index.cjs.js.map +1 -0
- package/dist/nile-code-editor/index.esm.js +1 -0
- package/dist/nile-code-editor/nile-code-editor.cjs.js +3 -0
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -0
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js +2 -0
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -0
- package/dist/nile-code-editor/nile-code-editor.css.esm.js +30 -0
- package/dist/nile-code-editor/nile-code-editor.esm.js +9 -0
- package/dist/nile-icon/icons/svg/arrowright.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/arrowright.cjs.js.map +1 -1
- package/dist/nile-icon/icons/svg/arrowright.esm.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
- package/dist/nile-icon-button/nile-icon-button.esm.js +4 -3
- package/dist/nile-switcher/index.cjs.js +1 -1
- package/dist/nile-switcher/index.esm.js +1 -1
- package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.css.esm.js +13 -2
- package/dist/nile-switcher/nile-switcher.esm.js +38 -30
- package/dist/nile-tag/nile-tag.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.css.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.css.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.css.esm.js +9 -17
- package/dist/nile-tag/nile-tag.esm.js +3 -3
- package/dist/nile-toast/nile-toast.css.cjs.js +1 -1
- package/dist/nile-toast/nile-toast.css.cjs.js.map +1 -1
- package/dist/nile-toast/nile-toast.css.esm.js +4 -4
- package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.esm.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.esm.js +2 -2
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-breadcrumb/index.d.ts +1 -0
- package/dist/src/nile-breadcrumb/index.js +2 -0
- package/dist/src/nile-breadcrumb/index.js.map +1 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.css.d.ts +12 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.css.js +18 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.css.js.map +1 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.d.ts +35 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.js +61 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.js.map +1 -0
- package/dist/src/nile-breadcrumb-item/index.d.ts +1 -0
- package/dist/src/nile-breadcrumb-item/index.js +2 -0
- package/dist/src/nile-breadcrumb-item/index.js.map +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.css.d.ts +12 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.css.js +47 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.css.js.map +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.d.ts +34 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js +74 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js.map +1 -0
- package/dist/src/nile-card/index.d.ts +1 -0
- package/dist/src/nile-card/index.js +2 -0
- package/dist/src/nile-card/index.js.map +1 -0
- package/dist/src/nile-card/nile-card.css.d.ts +12 -0
- package/dist/src/nile-card/nile-card.css.js +71 -0
- package/dist/src/nile-card/nile-card.css.js.map +1 -0
- package/dist/src/nile-card/nile-card.d.ts +26 -0
- package/dist/src/nile-card/nile-card.js +46 -0
- package/dist/src/nile-card/nile-card.js.map +1 -0
- package/dist/src/nile-code-editor/extensionSetup.d.ts +33 -0
- package/dist/src/nile-code-editor/extensionSetup.js +63 -0
- package/dist/src/nile-code-editor/extensionSetup.js.map +1 -0
- package/dist/src/nile-code-editor/index.d.ts +1 -0
- package/dist/src/nile-code-editor/index.js +2 -0
- package/dist/src/nile-code-editor/index.js.map +1 -0
- package/dist/src/nile-code-editor/nile-code-editor.css.d.ts +12 -0
- package/dist/src/nile-code-editor/nile-code-editor.css.js +42 -0
- package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -0
- package/dist/src/nile-code-editor/nile-code-editor.d.ts +43 -0
- package/dist/src/nile-code-editor/nile-code-editor.js +114 -0
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/arrowright.d.ts +1 -1
- package/dist/src/nile-icon/icons/svg/arrowright.js +1 -1
- package/dist/src/nile-icon/icons/svg/arrowright.js.map +1 -1
- package/dist/src/nile-icon-button/nile-icon-button.d.ts +2 -1
- package/dist/src/nile-icon-button/nile-icon-button.js +9 -6
- package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.css.js +11 -0
- package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.d.ts +11 -5
- package/dist/src/nile-switcher/nile-switcher.js +55 -7
- package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/dist/src/nile-tag/nile-tag.css.js +7 -15
- package/dist/src/nile-tag/nile-tag.css.js.map +1 -1
- package/dist/src/nile-tag/nile-tag.d.ts +1 -0
- package/dist/src/nile-tag/nile-tag.js +21 -2
- package/dist/src/nile-tag/nile-tag.js.map +1 -1
- package/dist/src/nile-toast/nile-toast.css.js +4 -4
- package/dist/src/nile-toast/nile-toast.css.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.js +2 -2
- package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +5 -1
- package/src/nile-breadcrumb/index.ts +1 -0
- package/src/nile-breadcrumb/nile-breadcrumb.css.ts +20 -0
- package/src/nile-breadcrumb/nile-breadcrumb.ts +78 -0
- package/src/nile-breadcrumb-item/index.ts +1 -0
- package/src/nile-breadcrumb-item/nile-breadcrumb-item.css.ts +49 -0
- package/src/nile-breadcrumb-item/nile-breadcrumb-item.ts +83 -0
- package/src/nile-card/index.ts +1 -0
- package/src/nile-card/nile-card.css.ts +73 -0
- package/src/nile-card/nile-card.ts +53 -0
- package/src/nile-code-editor/extensionSetup.ts +125 -0
- package/src/nile-code-editor/index.ts +1 -0
- package/src/nile-code-editor/nile-code-editor.css.ts +44 -0
- package/src/nile-code-editor/nile-code-editor.ts +127 -0
- package/src/nile-icon/icons/svg/arrowright.ts +1 -1
- package/src/nile-icon-button/nile-icon-button.ts +9 -6
- package/src/nile-switcher/nile-switcher.css.ts +11 -0
- package/src/nile-switcher/nile-switcher.ts +70 -10
- package/src/nile-tag/nile-tag.css.ts +7 -15
- package/src/nile-tag/nile-tag.ts +24 -2
- package/src/nile-toast/nile-toast.css.ts +4 -4
- package/src/nile-tooltip/nile-tooltip.css.ts +1 -1
- package/src/nile-tooltip/nile-tooltip.ts +2 -2
package/package.json
CHANGED
package/src/index.ts
CHANGED
@@ -29,7 +29,7 @@ export { NileErrorMessage } from './nile-error-message';
|
|
29
29
|
export { NileFormErrorMessage } from './nile-form-error-message';
|
30
30
|
export { NileFormHelpText } from './nile-form-help-text';
|
31
31
|
export { NileCalendar } from './nile-calendar';
|
32
|
-
export { NileLink} from './nile-link';
|
32
|
+
export { NileLink } from './nile-link';
|
33
33
|
export { NileButtonToggleGroup } from './nile-button-toggle-group';
|
34
34
|
export { NileButtonToggle } from './nile-button-toggle';
|
35
35
|
export { NileSwitcher } from './nile-switcher';
|
@@ -39,4 +39,8 @@ export { NileErrorNotification } from './nile-error-notification';
|
|
39
39
|
export { NileTabGroup } from './nile-tab-group';
|
40
40
|
export { NileTab } from './nile-tab';
|
41
41
|
export { NileTabPanel } from './nile-tab-panel';
|
42
|
+
export { NileCodeEditor } from './nile-code-editor';
|
42
43
|
export { NileToast } from './nile-toast';
|
44
|
+
export { NileBreadcrumb } from './nile-breadcrumb';
|
45
|
+
export { NileBreadcrumbItem } from './nile-breadcrumb-item';
|
46
|
+
export { NileCard } from './nile-card';
|
@@ -0,0 +1 @@
|
|
1
|
+
export {NileBreadcrumb} from './nile-breadcrumb';
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { css } from 'lit-element';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Breadcrumb CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
:host {
|
15
|
+
display: flex;
|
16
|
+
align-items: center;
|
17
|
+
}
|
18
|
+
`;
|
19
|
+
|
20
|
+
export default [styles];
|
@@ -0,0 +1,78 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {
|
9
|
+
LitElement,
|
10
|
+
html,
|
11
|
+
property,
|
12
|
+
CSSResultArray,
|
13
|
+
TemplateResult,
|
14
|
+
} from 'lit-element';
|
15
|
+
import { customElement } from 'lit/decorators.js';
|
16
|
+
import { styles } from './nile-breadcrumb.css';
|
17
|
+
import NileElement from '../internal/nile-element';
|
18
|
+
/**
|
19
|
+
* Nile BreadCrumb component.
|
20
|
+
*
|
21
|
+
* @tag nile-breadcrumb
|
22
|
+
*
|
23
|
+
*/
|
24
|
+
@customElement('nile-breadcrumb')
|
25
|
+
export class NileBreadcrumb extends NileElement {
|
26
|
+
/**
|
27
|
+
* The styles for Breadcrumb
|
28
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
29
|
+
*/
|
30
|
+
public static get styles(): CSSResultArray {
|
31
|
+
return [styles];
|
32
|
+
}
|
33
|
+
|
34
|
+
/* #endregion */
|
35
|
+
|
36
|
+
/* #region Methods */
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Render method
|
40
|
+
* @slot This is a slot test
|
41
|
+
*/
|
42
|
+
connectedCallback() {
|
43
|
+
super.connectedCallback();
|
44
|
+
this.updateComplete.then(() => {
|
45
|
+
this.changeLastItem();
|
46
|
+
});
|
47
|
+
}
|
48
|
+
|
49
|
+
private changeLastItem() {
|
50
|
+
const items: any = [...this.querySelectorAll('nile-breadcrumb-item')];
|
51
|
+
const itemslength = items.length;
|
52
|
+
const lastItem = items[itemslength - 1];
|
53
|
+
lastItem.isLast = true;
|
54
|
+
}
|
55
|
+
|
56
|
+
private handleRemoveClick(event: any) {
|
57
|
+
this.emit('nile-click', { value: event.target.innerText });
|
58
|
+
}
|
59
|
+
|
60
|
+
public render(): TemplateResult {
|
61
|
+
return html`
|
62
|
+
<slot
|
63
|
+
@nile-click-item=${this.handleRemoveClick}
|
64
|
+
class="breadcrumb"
|
65
|
+
></slot>
|
66
|
+
`;
|
67
|
+
}
|
68
|
+
|
69
|
+
/* #endregion */
|
70
|
+
}
|
71
|
+
|
72
|
+
export default NileBreadcrumb;
|
73
|
+
|
74
|
+
declare global {
|
75
|
+
interface HTMLElementTagNameMap {
|
76
|
+
'nile-breadcrumb': NileBreadcrumb;
|
77
|
+
}
|
78
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {NileBreadcrumbItem} from './nile-breadcrumb-item';
|
@@ -0,0 +1,49 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { css } from 'lit-element';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Breadcrumb-item CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
:host {
|
15
|
+
display: flex;
|
16
|
+
align-items: center;
|
17
|
+
text-align: center;
|
18
|
+
font-feature-settings: 'clig' off, 'liga' off;
|
19
|
+
font-family: var(--nile-font-family-serif);
|
20
|
+
font-size: var(--nile-font-size-small);
|
21
|
+
font-style: normal;
|
22
|
+
font-weight: var(--nile-font-weight-regular);
|
23
|
+
line-height:16.8px;
|
24
|
+
letter-spacing: 0.2px;
|
25
|
+
}
|
26
|
+
|
27
|
+
.nile-breadcrumb-item__arrow {
|
28
|
+
margin: 0 8px;
|
29
|
+
}
|
30
|
+
|
31
|
+
.nile-breadcrumb-item__arrow-hidden {
|
32
|
+
display: none;
|
33
|
+
}
|
34
|
+
|
35
|
+
.nile-breadcrumb-item__slot-text {
|
36
|
+
color: var(--nile-colors-dark-500);
|
37
|
+
}
|
38
|
+
|
39
|
+
.nile-breadcrumb-item__slot-text:hover {
|
40
|
+
color: var(--nile-colors-primary-600);
|
41
|
+
cursor: pointer;
|
42
|
+
}
|
43
|
+
|
44
|
+
.nile-breadcrumb-item__last-slot-text {
|
45
|
+
color: #026e78;
|
46
|
+
}
|
47
|
+
`;
|
48
|
+
|
49
|
+
export default [styles];
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {
|
9
|
+
LitElement,
|
10
|
+
html,
|
11
|
+
property,
|
12
|
+
CSSResultArray,
|
13
|
+
TemplateResult,
|
14
|
+
} from 'lit-element';
|
15
|
+
import { customElement, state } from 'lit/decorators.js';
|
16
|
+
import { classMap } from 'lit/directives/class-map.js';
|
17
|
+
import { styles } from './nile-breadcrumb-item.css';
|
18
|
+
import NileElement from '../internal/nile-element';
|
19
|
+
/**
|
20
|
+
* Nile BreadCrumb Item component.
|
21
|
+
*
|
22
|
+
* @tag nile-breadcrumb-item
|
23
|
+
*
|
24
|
+
*/
|
25
|
+
@customElement('nile-breadcrumb-item')
|
26
|
+
export class NileBreadcrumbItem extends NileElement {
|
27
|
+
/**
|
28
|
+
* The styles for BreadcrumbItem
|
29
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
30
|
+
*/
|
31
|
+
public static get styles(): CSSResultArray {
|
32
|
+
return [styles];
|
33
|
+
}
|
34
|
+
|
35
|
+
@state() private isLast = false;
|
36
|
+
|
37
|
+
/* #endregion */
|
38
|
+
|
39
|
+
/* #region Methods */
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Render method
|
43
|
+
* @slot This is a slot test
|
44
|
+
*/
|
45
|
+
private handleClick() {
|
46
|
+
if (this.isLast) {
|
47
|
+
return;
|
48
|
+
}
|
49
|
+
this.emit('nile-click-item');
|
50
|
+
}
|
51
|
+
|
52
|
+
public render(): TemplateResult {
|
53
|
+
return html`
|
54
|
+
<slot
|
55
|
+
class=${classMap({
|
56
|
+
'nile-breadcrumb-item__slot-text': !this.isLast,
|
57
|
+
'nile-breadcrumb-item__last-slot-text': this.isLast,
|
58
|
+
})}
|
59
|
+
@click=${this.handleClick}
|
60
|
+
></slot>
|
61
|
+
<nile-icon
|
62
|
+
name="arrowright"
|
63
|
+
aria-label="arrowright"
|
64
|
+
color="var(--nile-colors-dark-500)"
|
65
|
+
class=${classMap({
|
66
|
+
'nile-breadcrumb-item__arrow': true,
|
67
|
+
'nile-breadcrumb-item__arrow-hidden': this.isLast,
|
68
|
+
})}
|
69
|
+
size="14"
|
70
|
+
></nile-icon>
|
71
|
+
`;
|
72
|
+
}
|
73
|
+
|
74
|
+
/* #endregion */
|
75
|
+
}
|
76
|
+
|
77
|
+
export default NileBreadcrumbItem;
|
78
|
+
|
79
|
+
declare global {
|
80
|
+
interface HTMLElementTagNameMap {
|
81
|
+
'nile-breadcrumb-item': NileBreadcrumbItem;
|
82
|
+
}
|
83
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { NileCard } from './nile-card';
|
@@ -0,0 +1,73 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {css} from 'lit-element';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Card CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
|
15
|
+
:host {
|
16
|
+
box-sizing: border-box;
|
17
|
+
}
|
18
|
+
|
19
|
+
:host *,
|
20
|
+
:host *::before,
|
21
|
+
:host *::after {
|
22
|
+
box-sizing: inherit;
|
23
|
+
}
|
24
|
+
|
25
|
+
[hidden] {
|
26
|
+
display: none !important;
|
27
|
+
}
|
28
|
+
|
29
|
+
:host {
|
30
|
+
--border-color: var(--nile-colors-neutral-400);
|
31
|
+
--border-radius: 8px;
|
32
|
+
--border-width: 1px;
|
33
|
+
--padding: 18px;
|
34
|
+
--footer-padding: 9px 18px;
|
35
|
+
;
|
36
|
+
|
37
|
+
display: inline-block;
|
38
|
+
}
|
39
|
+
|
40
|
+
.card {
|
41
|
+
display: flex;
|
42
|
+
flex-direction: column;
|
43
|
+
background-color: var(--nile-colors-white-base);
|
44
|
+
border: solid var(--border-width) var(--border-color);
|
45
|
+
border-radius: var(--border-radius);
|
46
|
+
}
|
47
|
+
|
48
|
+
.card__body {
|
49
|
+
display: block;
|
50
|
+
padding: var(--padding);
|
51
|
+
}
|
52
|
+
|
53
|
+
.card--has-footer {
|
54
|
+
border-radius: var(--border-radius) var(--border-radius) 0 0;
|
55
|
+
border-bottom: none;
|
56
|
+
}
|
57
|
+
|
58
|
+
.card__footer {
|
59
|
+
display: block;
|
60
|
+
border-top: solid var(--border-width) var(--border-color);
|
61
|
+
padding: var(--footer-padding);
|
62
|
+
border: 1px solid var(--nile-colors-neutral-500);
|
63
|
+
background: var(--nile-colors-neutral-100);
|
64
|
+
border-radius: 0 0 4px 4px;
|
65
|
+
}
|
66
|
+
|
67
|
+
.card:not(.card--has-footer) .card__footer {
|
68
|
+
display: none;
|
69
|
+
}
|
70
|
+
|
71
|
+
`;
|
72
|
+
|
73
|
+
export default [styles];
|
@@ -0,0 +1,53 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';
|
9
|
+
import { customElement } from 'lit/decorators.js';
|
10
|
+
import {styles} from './nile-card.css';
|
11
|
+
import { classMap } from 'lit/directives/class-map.js';
|
12
|
+
import { HasSlotController } from '../internal/slot';
|
13
|
+
import NileElements from '../internal/nile-element';
|
14
|
+
import { CSSResultGroup } from 'lit';
|
15
|
+
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Nile icon component.
|
19
|
+
*
|
20
|
+
* @tag nile-card
|
21
|
+
*
|
22
|
+
*/
|
23
|
+
@customElement('nile-card')
|
24
|
+
export class NileCard extends NileElements {
|
25
|
+
|
26
|
+
static styles: CSSResultGroup = styles;
|
27
|
+
|
28
|
+
private readonly hasSlotController = new HasSlotController(this, 'footer');
|
29
|
+
|
30
|
+
render() {
|
31
|
+
return html`
|
32
|
+
<div
|
33
|
+
part="base"
|
34
|
+
class=${classMap({
|
35
|
+
card: true,
|
36
|
+
'card--has-footer': this.hasSlotController.test('footer'),
|
37
|
+
})}
|
38
|
+
>
|
39
|
+
<slot part="body" class="card__body"></slot>
|
40
|
+
</div>
|
41
|
+
<slot name="footer" part="footer" ?hidden="${!this.hasSlotController.test('footer')}" class="card__footer"></slot>
|
42
|
+
`;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
export default NileCard;
|
48
|
+
|
49
|
+
declare global {
|
50
|
+
interface HTMLElementTagNameMap {
|
51
|
+
'nile-card': NileCard;
|
52
|
+
}
|
53
|
+
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
import {
|
2
|
+
KeyBinding,
|
3
|
+
lineNumbers,
|
4
|
+
highlightActiveLineGutter,
|
5
|
+
highlightSpecialChars,
|
6
|
+
drawSelection,
|
7
|
+
dropCursor,
|
8
|
+
rectangularSelection,
|
9
|
+
crosshairCursor,
|
10
|
+
highlightActiveLine,
|
11
|
+
keymap,
|
12
|
+
} from '@codemirror/view';
|
13
|
+
import { EditorState, Extension } from '@codemirror/state';
|
14
|
+
import { history, defaultKeymap, historyKeymap } from '@codemirror/commands';
|
15
|
+
import { highlightSelectionMatches, searchKeymap } from '@codemirror/search';
|
16
|
+
import {
|
17
|
+
closeBrackets,
|
18
|
+
autocompletion,
|
19
|
+
closeBracketsKeymap,
|
20
|
+
completionKeymap,
|
21
|
+
} from '@codemirror/autocomplete';
|
22
|
+
import {
|
23
|
+
foldGutter,
|
24
|
+
indentOnInput,
|
25
|
+
syntaxHighlighting,
|
26
|
+
defaultHighlightStyle,
|
27
|
+
bracketMatching,
|
28
|
+
indentUnit,
|
29
|
+
foldKeymap,
|
30
|
+
} from '@codemirror/language';
|
31
|
+
|
32
|
+
import { lintKeymap } from '@codemirror/lint';
|
33
|
+
|
34
|
+
export interface BasicSetupOptions extends MinimalSetupOptions {
|
35
|
+
lineNumbers?: boolean;
|
36
|
+
highlightActiveLineGutter?: boolean;
|
37
|
+
foldGutter?: boolean;
|
38
|
+
dropCursor?: boolean;
|
39
|
+
allowMultipleSelections?: boolean;
|
40
|
+
indentOnInput?: boolean;
|
41
|
+
bracketMatching?: boolean;
|
42
|
+
closeBrackets?: boolean;
|
43
|
+
autocompletion?: boolean;
|
44
|
+
rectangularSelection?: boolean;
|
45
|
+
crosshairCursor?: boolean;
|
46
|
+
highlightActiveLine?: boolean;
|
47
|
+
highlightSelectionMatches?: boolean;
|
48
|
+
closeBracketsKeymap?: boolean;
|
49
|
+
searchKeymap?: boolean;
|
50
|
+
foldKeymap?: boolean;
|
51
|
+
completionKeymap?: boolean;
|
52
|
+
lintKeymap?: boolean;
|
53
|
+
tabSize?: number;
|
54
|
+
}
|
55
|
+
|
56
|
+
export const isValidSetup = (item: any) => {
|
57
|
+
return typeof item === 'undefined' || item;
|
58
|
+
};
|
59
|
+
|
60
|
+
export const basicSetup = (options: BasicSetupOptions = {}): Extension[] => {
|
61
|
+
const { crosshairCursor: initCrosshairCursor = false } = options;
|
62
|
+
let keymaps: KeyBinding[] = [];
|
63
|
+
isValidSetup(options.defaultKeymap) && keymaps.push(...defaultKeymap);
|
64
|
+
isValidSetup(options.closeBracketsKeymap) &&
|
65
|
+
keymaps.push(...closeBracketsKeymap);
|
66
|
+
isValidSetup(options.searchKeymap) && keymaps.push(...searchKeymap);
|
67
|
+
isValidSetup(options.historyKeymap) && keymaps.push(...historyKeymap);
|
68
|
+
isValidSetup(options.foldKeymap) && keymaps.push(...foldKeymap);
|
69
|
+
isValidSetup(options.lintKeymap) && keymaps.push(...lintKeymap);
|
70
|
+
const extensions: Extension[] = [];
|
71
|
+
isValidSetup(options.lineNumbers) && extensions.push(lineNumbers());
|
72
|
+
isValidSetup(options.highlightActiveLineGutter) &&
|
73
|
+
extensions.push(highlightActiveLineGutter());
|
74
|
+
isValidSetup(options.highlightSpecialChars) &&
|
75
|
+
extensions.push(highlightSpecialChars());
|
76
|
+
isValidSetup(options.history) && extensions.push(history());
|
77
|
+
isValidSetup(options.foldGutter) && extensions.push(foldGutter());
|
78
|
+
isValidSetup(options.drawSelection) && extensions.push(drawSelection());
|
79
|
+
isValidSetup(options.dropCursor) && extensions.push(dropCursor());
|
80
|
+
isValidSetup(options.allowMultipleSelections) &&
|
81
|
+
extensions.push(EditorState.allowMultipleSelections.of(true));
|
82
|
+
isValidSetup(options.indentOnInput) && extensions.push(indentOnInput());
|
83
|
+
isValidSetup(options.syntaxHighlighting) &&
|
84
|
+
extensions.push(
|
85
|
+
syntaxHighlighting(defaultHighlightStyle, { fallback: true })
|
86
|
+
);
|
87
|
+
isValidSetup(options.bracketMatching) && extensions.push(bracketMatching());
|
88
|
+
isValidSetup(options.closeBrackets) && extensions.push(closeBrackets());
|
89
|
+
isValidSetup(options.autocompletion) && extensions.push(autocompletion());
|
90
|
+
isValidSetup(options.rectangularSelection) &&
|
91
|
+
extensions.push(rectangularSelection());
|
92
|
+
isValidSetup(options.crosshairCursor) && extensions.push(crosshairCursor());
|
93
|
+
isValidSetup(options.highlightActiveLine) &&
|
94
|
+
extensions.push(highlightActiveLine());
|
95
|
+
isValidSetup(options.highlightSelectionMatches) &&
|
96
|
+
extensions.push(highlightSelectionMatches());
|
97
|
+
if (options.tabSize && typeof options.tabSize === 'number')
|
98
|
+
extensions.push(indentUnit.of(' '.repeat(options.tabSize)));
|
99
|
+
return extensions.concat([keymap.of(keymaps.flat())]).filter(Boolean);
|
100
|
+
};
|
101
|
+
|
102
|
+
export interface MinimalSetupOptions {
|
103
|
+
highlightSpecialChars?: boolean;
|
104
|
+
history?: boolean;
|
105
|
+
drawSelection?: boolean;
|
106
|
+
syntaxHighlighting?: boolean;
|
107
|
+
defaultKeymap?: boolean;
|
108
|
+
historyKeymap?: boolean;
|
109
|
+
}
|
110
|
+
|
111
|
+
export const minimalSetup = (options: MinimalSetupOptions = {}) => {
|
112
|
+
let keymaps: KeyBinding[] = [];
|
113
|
+
isValidSetup(options.defaultKeymap) && keymaps.push(...defaultKeymap);
|
114
|
+
isValidSetup(options.historyKeymap) && keymaps.push(...historyKeymap);
|
115
|
+
const extensions: Extension[] = [];
|
116
|
+
isValidSetup(options.highlightSpecialChars) &&
|
117
|
+
extensions.push(highlightSpecialChars());
|
118
|
+
isValidSetup(options.history) && extensions.push(history());
|
119
|
+
isValidSetup(options.drawSelection) && extensions.push(drawSelection());
|
120
|
+
isValidSetup(options.syntaxHighlighting) &&
|
121
|
+
extensions.push(
|
122
|
+
syntaxHighlighting(defaultHighlightStyle, { fallback: true })
|
123
|
+
);
|
124
|
+
return extensions.concat([keymap.of(keymaps.flat())]).filter(Boolean);
|
125
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { NileCodeEditor } from './nile-code-editor';
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { css } from 'lit-element';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* CodeEditor CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
:host {
|
15
|
+
display: block;
|
16
|
+
}
|
17
|
+
|
18
|
+
.code-mirror {
|
19
|
+
display: flex;
|
20
|
+
justify-content: flex-end;
|
21
|
+
flex-direction: row-reverse;
|
22
|
+
gap: 0.6rem;
|
23
|
+
}
|
24
|
+
|
25
|
+
.cm-editor {
|
26
|
+
overflow: hidden;
|
27
|
+
width: 100%;
|
28
|
+
height: 100%;
|
29
|
+
}
|
30
|
+
|
31
|
+
.ͼ1.cm-focused {
|
32
|
+
outline: none;
|
33
|
+
}
|
34
|
+
|
35
|
+
.code-editor__icon__container {
|
36
|
+
cursor: pointer;
|
37
|
+
}
|
38
|
+
|
39
|
+
.code-editor__icon__container {
|
40
|
+
padding-right: 5px;
|
41
|
+
}
|
42
|
+
`;
|
43
|
+
|
44
|
+
export default [styles];
|
@@ -0,0 +1,127 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {
|
9
|
+
LitElement,
|
10
|
+
html,
|
11
|
+
property,
|
12
|
+
CSSResultArray,
|
13
|
+
TemplateResult,
|
14
|
+
} from 'lit-element';
|
15
|
+
import { customElement, query } from 'lit/decorators.js';
|
16
|
+
import { styles } from './nile-code-editor.css';
|
17
|
+
import { EditorView } from 'codemirror';
|
18
|
+
import { ViewUpdate } from '@codemirror/view';
|
19
|
+
import { EditorState, Compartment } from '@codemirror/state';
|
20
|
+
import { javascript, javascriptLanguage } from '@codemirror/lang-javascript';
|
21
|
+
import { autocompletion } from '@codemirror/autocomplete';
|
22
|
+
import { CompletionContext } from '@codemirror/autocomplete';
|
23
|
+
import NileElement from '../internal/nile-element';
|
24
|
+
import { basicSetup } from './extensionSetup';
|
25
|
+
|
26
|
+
// Choose the appropriate mode for your use case
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Nile icon component.
|
30
|
+
*
|
31
|
+
* @tag nile-code-editor
|
32
|
+
*
|
33
|
+
*/
|
34
|
+
@customElement('nile-code-editor')
|
35
|
+
export class NileCodeEditor extends NileElement {
|
36
|
+
@query('.code-mirror') codeEditor: HTMLInputElement;
|
37
|
+
@property({ type: Boolean }) multiline: true;
|
38
|
+
@property({ type: String }) value: true;
|
39
|
+
@property({ type: String }) customOptions: any;
|
40
|
+
@property({ type: String }) showLineNumbers: any;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* The styles for CodeEditor
|
44
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
45
|
+
*/
|
46
|
+
public static get styles(): CSSResultArray {
|
47
|
+
return [styles];
|
48
|
+
}
|
49
|
+
|
50
|
+
connectedCallback(): void {
|
51
|
+
super.connectedCallback();
|
52
|
+
}
|
53
|
+
|
54
|
+
view: EditorView;
|
55
|
+
|
56
|
+
convertToSingleLine(code: any) {
|
57
|
+
// Remove line breaks and unnecessary whitespace
|
58
|
+
return code.replace(/\s+/g, ' ').trim();
|
59
|
+
}
|
60
|
+
lineNumbersComp = new Compartment();
|
61
|
+
|
62
|
+
updated() {
|
63
|
+
const customAutoCompletions = javascriptLanguage.data.of({
|
64
|
+
autocomplete: this.customOptions,
|
65
|
+
});
|
66
|
+
let startState = EditorState.create({
|
67
|
+
doc: !this.multiline ? this.convertToSingleLine(this.value) : this.value,
|
68
|
+
extensions: [
|
69
|
+
basicSetup({
|
70
|
+
lineNumbers: !!this.showLineNumbers,
|
71
|
+
foldGutter: !this.multiline ? false : true,
|
72
|
+
}),
|
73
|
+
customAutoCompletions,
|
74
|
+
autocompletion(),
|
75
|
+
javascript(),
|
76
|
+
!this.multiline ? this.restrictSingleLine() : [],
|
77
|
+
EditorView.updateListener.of((v: ViewUpdate) => {
|
78
|
+
if (v.docChanged) {
|
79
|
+
this.emitValues(this.view.state.doc.toString());
|
80
|
+
}
|
81
|
+
}),
|
82
|
+
],
|
83
|
+
});
|
84
|
+
|
85
|
+
this.view = new EditorView({
|
86
|
+
state: startState,
|
87
|
+
parent: this.codeEditor,
|
88
|
+
});
|
89
|
+
}
|
90
|
+
|
91
|
+
emitValues(value: string) {
|
92
|
+
this.emit('nile-change', { value: value });
|
93
|
+
}
|
94
|
+
|
95
|
+
expandCodeEditor() {
|
96
|
+
this.emit('nile-expand', { expand: true });
|
97
|
+
}
|
98
|
+
|
99
|
+
restrictSingleLine() {
|
100
|
+
return EditorState.transactionFilter.of(tr =>
|
101
|
+
tr.newDoc.lines > 1 ? [] : tr
|
102
|
+
);
|
103
|
+
}
|
104
|
+
public render(): TemplateResult {
|
105
|
+
return html`<div class="code-mirror">
|
106
|
+
${!this.multiline
|
107
|
+
? html`<nile-icon
|
108
|
+
name="fullscreenshrink"
|
109
|
+
class="code-editor__icon__container"
|
110
|
+
size="16"
|
111
|
+
color="black"
|
112
|
+
@click="${(e: CustomEvent) => this.expandCodeEditor()}"
|
113
|
+
></nile-icon>`
|
114
|
+
: ''}
|
115
|
+
</div>`;
|
116
|
+
}
|
117
|
+
|
118
|
+
/* #endregion */
|
119
|
+
}
|
120
|
+
|
121
|
+
export default NileCodeEditor;
|
122
|
+
|
123
|
+
declare global {
|
124
|
+
interface HTMLElementTagNameMap {
|
125
|
+
'nile-code-editor': NileCodeEditor;
|
126
|
+
}
|
127
|
+
}
|