@limetech/lime-crm-building-blocks 1.48.0 → 1.49.0
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/CHANGELOG.md +18 -0
- package/dist/cjs/decorator-7b523efc.js +42 -0
- package/dist/cjs/{keycodes-a546a15c.js → keycodes-a6c36f6d.js} +4 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +2 -22
- package/dist/cjs/limebb-text-editor-picker.cjs.entry.js +9 -3
- package/dist/cjs/limebb-text-editor.cjs.entry.js +232 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/text-editor/text-editor-picker.css +9 -10
- package/dist/collection/components/text-editor/text-editor-picker.js +25 -1
- package/dist/collection/components/text-editor/text-editor-types.js +1 -0
- package/dist/collection/components/text-editor/text-editor.js +363 -0
- package/dist/collection/components/text-editor/utils/searcher-utils.js +1 -0
- package/dist/collection/util/random-string.js +17 -0
- package/dist/components/decorator.js +39 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/keycodes.js +3 -1
- package/dist/components/limebb-limeobject-file-viewer.js +1 -21
- package/dist/components/limebb-text-editor-picker.js +1 -79
- package/dist/components/limebb-text-editor.d.ts +11 -0
- package/dist/components/limebb-text-editor.js +264 -0
- package/dist/components/text-editor-picker.js +88 -0
- package/dist/esm/decorator-001aa03c.js +39 -0
- package/dist/esm/keycodes-7f4bac6f.js +6 -0
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/limebb-browser.entry.js +1 -1
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +1 -21
- package/dist/esm/limebb-text-editor-picker.entry.js +9 -3
- package/dist/esm/limebb-text-editor.entry.js +228 -0
- package/dist/esm/loader.js +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-cc1dd71c.entry.js → p-18fbd227.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-214188d4.js +1 -0
- package/dist/lime-crm-building-blocks/p-2ba9c2fa.js +1 -0
- package/dist/lime-crm-building-blocks/p-3b38867a.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-41e293c2.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-8e4cbfe3.entry.js +1 -0
- package/dist/types/components/text-editor/text-editor-picker.d.ts +1 -0
- package/dist/types/components/text-editor/text-editor-types.d.ts +10 -0
- package/dist/types/components/text-editor/text-editor.d.ts +82 -0
- package/dist/types/components/text-editor/utils/searcher-utils.d.ts +9 -0
- package/dist/types/components.d.ts +61 -0
- package/dist/types/util/random-string.d.ts +1 -0
- package/package.json +2 -2
- package/dist/esm/keycodes-3f25db05.js +0 -4
- package/dist/lime-crm-building-blocks/p-06d2c469.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-5ccc10cc.js +0 -1
- package/dist/lime-crm-building-blocks/p-c62cb511.entry.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [1.49.0](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.48.0...v1.49.0) (2024-11-08)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
* **text editor:** add create random string ([9cd26d8](https://github.com/Lundalogik/lime-crm-building-blocks/commit/9cd26d8c0a1f2f3846fdc5c3dffe08fd70388e5b))
|
|
7
|
+
* **text editor:** add editor wrapper search interfaces ([d4e3e4f](https://github.com/Lundalogik/lime-crm-building-blocks/commit/d4e3e4fc6d20022a95e4aaca051dfdd30b6df306))
|
|
8
|
+
* **text editor:** add text editor wrapper component ([e75004f](https://github.com/Lundalogik/lime-crm-building-blocks/commit/e75004f8a34e1769a1c2c407adce1dcd52e085f1))
|
|
9
|
+
* **text-editor:** add types for mapping triggers ([938c77c](https://github.com/Lundalogik/lime-crm-building-blocks/commit/938c77cc3729ecee05723f97638269640ad37ba9))
|
|
10
|
+
* **text-editor:** create href when adding mention ([e2ac812](https://github.com/Lundalogik/lime-crm-building-blocks/commit/e2ac812a878eb446cfc9daed1cf2cb94d488cd6d))
|
|
11
|
+
* **text-editor:** dynamically assign tagName and attributes using triggerMap ([feeefca](https://github.com/Lundalogik/lime-crm-building-blocks/commit/feeefca552d67bae8851ba190c0119c60682c73d))
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
* **text-editor-picker:** have default message as a prop ([87a0dc5](https://github.com/Lundalogik/lime-crm-building-blocks/commit/87a0dc5f67d50b00ce2bc5994435321dddccaab3))
|
|
16
|
+
* **text-editor-picker:** render an empty message ([19aa865](https://github.com/Lundalogik/lime-crm-building-blocks/commit/19aa865e39c874059321d2c635d7a25a3933c23b))
|
|
17
|
+
* **text-editor:** find user limetype ([a7b3144](https://github.com/Lundalogik/lime-crm-building-blocks/commit/a7b31441b8d7802e116e4fb3d71df361945ba5b2))
|
|
18
|
+
|
|
1
19
|
## [1.48.0](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.47.1...v1.48.0) (2024-11-06)
|
|
2
20
|
|
|
3
21
|
### Features
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const types = require('./types-c7646c23.js');
|
|
4
|
+
const factory = require('./factory-310afac1.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Gets an object with all limetypes where name is used as key
|
|
8
|
+
*
|
|
9
|
+
* @param options - state decorator options
|
|
10
|
+
* @returns state decorator
|
|
11
|
+
* @public
|
|
12
|
+
* @group Lime types
|
|
13
|
+
*/
|
|
14
|
+
function SelectLimeTypes(options = {}) {
|
|
15
|
+
const config = {
|
|
16
|
+
name: types.PlatformServiceName.LimeTypeRepository,
|
|
17
|
+
};
|
|
18
|
+
return factory.createStateDecorator(options, config);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get the limetype for the current context
|
|
22
|
+
*
|
|
23
|
+
* @param options - state decorator options
|
|
24
|
+
* @returns state decorator
|
|
25
|
+
* @public
|
|
26
|
+
* @group Lime types
|
|
27
|
+
*/
|
|
28
|
+
function SelectCurrentLimeType(options = {}) {
|
|
29
|
+
const config = {
|
|
30
|
+
name: types.PlatformServiceName.LimeTypeRepository,
|
|
31
|
+
};
|
|
32
|
+
options.map = [currentLimetype, ...(options.map || [])];
|
|
33
|
+
options.context = null;
|
|
34
|
+
return factory.createStateDecorator(options, config);
|
|
35
|
+
}
|
|
36
|
+
function currentLimetype(limetypes) {
|
|
37
|
+
const { limetype } = this.context;
|
|
38
|
+
return limetypes[limetype];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.SelectCurrentLimeType = SelectCurrentLimeType;
|
|
42
|
+
exports.SelectLimeTypes = SelectLimeTypes;
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["limebb-feed.cjs",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"lastVisitedTimestamp":[1,"last-visited-timestamp"]}]]],["limebb-kanban.cjs",[[1,"limebb-kanban",{"platform":[16],"context":[16],"items":[16],"paginationSize":[2,"pagination-size"],"groupBy":[513,"group-by"],"groups":[16]}]]],["limebb-date-range.cjs",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format.cjs",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-notification-list.cjs",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]}]]],["limebb-browser.cjs",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["limebb-component-config.cjs",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]}]]],["limebb-component-picker.cjs",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-dashboard-widget.cjs",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["limebb-icon-picker.cjs",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-info-tile.cjs",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]}]]],["limebb-info-tile-date-format.cjs",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["limebb-info-tile-decimal-format.cjs",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["limebb-info-tile-format.cjs",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["limebb-info-tile-relative-date-format.cjs",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["limebb-info-tile-unit-format.cjs",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["limebb-limeobject-file-viewer.cjs",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["limebb-locale-picker.cjs",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["limebb-mention.cjs",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["limebb-navigation-button.cjs",[[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["limebb-
|
|
18
|
+
return index.bootstrapLazy([["limebb-feed.cjs",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"lastVisitedTimestamp":[1,"last-visited-timestamp"]}]]],["limebb-kanban.cjs",[[1,"limebb-kanban",{"platform":[16],"context":[16],"items":[16],"paginationSize":[2,"pagination-size"],"groupBy":[513,"group-by"],"groups":[16]}]]],["limebb-date-range.cjs",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format.cjs",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-notification-list.cjs",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]}]]],["limebb-text-editor.cjs",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"selectedContext":[16],"uiType":[8,"ui-type"],"allowResize":[4,"allow-resize"],"value":[1],"items":[32],"customElements":[32],"registeredTriggers":[32],"editorPickerQuery":[32],"coworkerLimetype":[32],"isPickerOpen":[32]}]]],["limebb-browser.cjs",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["limebb-component-config.cjs",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]}]]],["limebb-component-picker.cjs",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-dashboard-widget.cjs",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["limebb-icon-picker.cjs",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-info-tile.cjs",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]}]]],["limebb-info-tile-date-format.cjs",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["limebb-info-tile-decimal-format.cjs",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["limebb-info-tile-format.cjs",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["limebb-info-tile-relative-date-format.cjs",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["limebb-info-tile-unit-format.cjs",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["limebb-limeobject-file-viewer.cjs",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["limebb-locale-picker.cjs",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["limebb-mention.cjs",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["limebb-navigation-button.cjs",[[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["limebb-kanban-column.cjs",[[1,"limebb-kanban-column",{"platform":[16],"context":[16],"columnHeading":[1,"column-heading"],"items":[16],"loading":[4],"paginationSize":[2,"pagination-size"],"displayedItemCount":[32]}]]],["limebb-currency-picker.cjs",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["limebb-date-picker.cjs",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["limebb-notification-item.cjs",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["limebb-text-editor-picker.cjs",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"emptyMessage":[1,"empty-message"]}]]],["limebb-empty-state_2.cjs",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}],[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["limebb-kanban-item.cjs",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]]], options);
|
|
19
19
|
});
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-dd1aef9e.js');
|
|
6
6
|
const types = require('./types-c7646c23.js');
|
|
7
|
-
const keycodes = require('./keycodes-
|
|
7
|
+
const keycodes = require('./keycodes-a6c36f6d.js');
|
|
8
8
|
const negate = require('./negate-14a67e26.js');
|
|
9
9
|
|
|
10
10
|
const browserCss = ":host(limebb-browser){isolation:isolate;display:flex;flex-direction:column;background-color:rgba(var(--contrast-100))}limel-input-field{position:sticky;top:0;z-index:1;padding:0.5rem 0.75rem;background-color:rgba(var(--contrast-100), 0.75);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem)}";
|
|
@@ -4,30 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-dd1aef9e.js');
|
|
6
6
|
const types = require('./types-c7646c23.js');
|
|
7
|
+
const decorator = require('./decorator-7b523efc.js');
|
|
7
8
|
const factory = require('./factory-310afac1.js');
|
|
8
9
|
const negate = require('./negate-14a67e26.js');
|
|
9
10
|
|
|
10
|
-
/**
|
|
11
|
-
* Get the limetype for the current context
|
|
12
|
-
*
|
|
13
|
-
* @param options - state decorator options
|
|
14
|
-
* @returns state decorator
|
|
15
|
-
* @public
|
|
16
|
-
* @group Lime types
|
|
17
|
-
*/
|
|
18
|
-
function SelectCurrentLimeType(options = {}) {
|
|
19
|
-
const config = {
|
|
20
|
-
name: types.PlatformServiceName.LimeTypeRepository,
|
|
21
|
-
};
|
|
22
|
-
options.map = [currentLimetype, ...(options.map || [])];
|
|
23
|
-
options.context = null;
|
|
24
|
-
return factory.createStateDecorator(options, config);
|
|
25
|
-
}
|
|
26
|
-
function currentLimetype(limetypes) {
|
|
27
|
-
const { limetype } = this.context;
|
|
28
|
-
return limetypes[limetype];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
11
|
/**
|
|
32
12
|
* Get the limeobject for the current context
|
|
33
13
|
*
|
|
@@ -199,7 +179,7 @@ __decorate([
|
|
|
199
179
|
SelectCurrentLimeObject()
|
|
200
180
|
], FileViewer.prototype, "limeobject", void 0);
|
|
201
181
|
__decorate([
|
|
202
|
-
SelectCurrentLimeType()
|
|
182
|
+
decorator.SelectCurrentLimeType()
|
|
203
183
|
], FileViewer.prototype, "limetype", void 0);
|
|
204
184
|
FileViewer.style = fileViewerCss;
|
|
205
185
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-dd1aef9e.js');
|
|
6
|
-
const keycodes = require('./keycodes-
|
|
6
|
+
const keycodes = require('./keycodes-a6c36f6d.js');
|
|
7
7
|
|
|
8
|
-
const textEditorPickerCss = ":host(limebb-text-editor-picker){animation:fade 0.
|
|
8
|
+
const textEditorPickerCss = ":host(limebb-text-editor-picker){animation:fade-in 0.3s ease forwards;animation-delay:0.1s;display:block;max-width:calc(100vw - 2rem);padding:0.125rem;border-radius:0.5rem;background-color:rgba(var(--contrast-100));box-shadow:var(--shadow-depth-16)}span{padding:0.25rem}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}";
|
|
9
9
|
|
|
10
10
|
const TextEditorPicker = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -20,6 +20,7 @@ const TextEditorPicker = class {
|
|
|
20
20
|
* Open state of the link-menu dialog
|
|
21
21
|
*/
|
|
22
22
|
this.open = false;
|
|
23
|
+
this.emptyMessage = '';
|
|
23
24
|
this.handleCancel = (event) => {
|
|
24
25
|
if (event instanceof KeyboardEvent && event.key !== keycodes.ESCAPE) {
|
|
25
26
|
return;
|
|
@@ -56,7 +57,12 @@ const TextEditorPicker = class {
|
|
|
56
57
|
document.removeEventListener('keyup', this.handleCancel);
|
|
57
58
|
}
|
|
58
59
|
render() {
|
|
59
|
-
|
|
60
|
+
if (this.items.length === 0) {
|
|
61
|
+
return index.h("span", null, this.emptyMessage);
|
|
62
|
+
}
|
|
63
|
+
return [
|
|
64
|
+
index.h("limel-list", { type: "selectable", items: this.items, onChange: this.selectOnChange }),
|
|
65
|
+
];
|
|
60
66
|
}
|
|
61
67
|
static get watchers() { return {
|
|
62
68
|
"open": ["watchOpen"]
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-dd1aef9e.js');
|
|
6
|
+
const types = require('./types-c7646c23.js');
|
|
7
|
+
const decorator = require('./decorator-7b523efc.js');
|
|
8
|
+
const keycodes = require('./keycodes-a6c36f6d.js');
|
|
9
|
+
require('./factory-310afac1.js');
|
|
10
|
+
|
|
11
|
+
const createRandomString = () => {
|
|
12
|
+
var _a;
|
|
13
|
+
if (!('crypto' in window) ||
|
|
14
|
+
typeof ((_a = window.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) !== 'function') {
|
|
15
|
+
return legacyCreateRandomString();
|
|
16
|
+
}
|
|
17
|
+
return 'a_' + crypto.randomUUID(); // ids must start with letters
|
|
18
|
+
};
|
|
19
|
+
function legacyCreateRandomString() {
|
|
20
|
+
const USE_HEX = 36;
|
|
21
|
+
const SKIP_LEADING_ZERODOT = 2;
|
|
22
|
+
const ASCII_A = 97;
|
|
23
|
+
const NUMBER_OF_LETTERS = 26;
|
|
24
|
+
return (String.fromCharCode(ASCII_A + Math.floor(Math.random() * NUMBER_OF_LETTERS)) +
|
|
25
|
+
Math.random().toString(USE_HEX).substring(SKIP_LEADING_ZERODOT) +
|
|
26
|
+
Math.random().toString(USE_HEX).substring(SKIP_LEADING_ZERODOT));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
30
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
31
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
32
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
33
|
+
else
|
|
34
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
35
|
+
if (d = decorators[i])
|
|
36
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
37
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
38
|
+
};
|
|
39
|
+
const findLimetypeByLabel = (label) => (limetypes) => {
|
|
40
|
+
return Object.values(limetypes).find(hasLabel(label));
|
|
41
|
+
};
|
|
42
|
+
const hasLabel = (label) => (object) => {
|
|
43
|
+
return (object === null || object === void 0 ? void 0 : object.label) === label;
|
|
44
|
+
};
|
|
45
|
+
const SEARCH_LIMIT = 20;
|
|
46
|
+
const LimeBBTextEditor = class {
|
|
47
|
+
constructor(hostRef) {
|
|
48
|
+
index.registerInstance(this, hostRef);
|
|
49
|
+
/**
|
|
50
|
+
* Set to `true` to allow the user to vertically resize the editor.
|
|
51
|
+
* Set to `false` to disable the resize functionality.
|
|
52
|
+
*/
|
|
53
|
+
this.allowResize = true;
|
|
54
|
+
this.value = '';
|
|
55
|
+
this.items = [];
|
|
56
|
+
this.customElements = [];
|
|
57
|
+
this.registeredTriggers = [];
|
|
58
|
+
/**
|
|
59
|
+
* Open state of the picker
|
|
60
|
+
*/
|
|
61
|
+
this.isPickerOpen = false;
|
|
62
|
+
this.activeTrigger = undefined;
|
|
63
|
+
this.triggerMap = {
|
|
64
|
+
'@': {
|
|
65
|
+
customElement: {
|
|
66
|
+
tagName: 'limebb-mention',
|
|
67
|
+
attributes: ['limetype', 'objectid', 'href'],
|
|
68
|
+
},
|
|
69
|
+
mapAttributes: (item) => ({
|
|
70
|
+
limetype: item.secondaryText,
|
|
71
|
+
objectid: item.value,
|
|
72
|
+
href: `object/${this.context.limetype}/${this.context.id}`,
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
this.handleGlobalKeyPress = (event) => {
|
|
77
|
+
const activeTrigger = this.activeTrigger !== undefined;
|
|
78
|
+
if (event.key === keycodes.ESCAPE) {
|
|
79
|
+
this.isPickerOpen = false;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (event.key === keycodes.BACKSPACE && this.value.length === 1) {
|
|
83
|
+
this.isPickerOpen = false;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if ((activeTrigger && event.key === keycodes.ENTER) ||
|
|
87
|
+
(activeTrigger && event.key === keycodes.TAB)) {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
this.globalClickListener = (event) => {
|
|
92
|
+
const element = event.target;
|
|
93
|
+
const clickedInside = this.textEditorElement.contains(element);
|
|
94
|
+
const activeTrigger = this.activeTrigger !== undefined;
|
|
95
|
+
if (this.isPickerOpen && !clickedInside) {
|
|
96
|
+
this.isPickerOpen = false;
|
|
97
|
+
}
|
|
98
|
+
if (clickedInside && activeTrigger) {
|
|
99
|
+
event.stopPropagation();
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
this.isPickerOpen = true;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
this.handleTriggerStart = (event) => {
|
|
105
|
+
event.stopPropagation();
|
|
106
|
+
this.isPickerOpen = true;
|
|
107
|
+
this.activeTrigger = event.detail.trigger;
|
|
108
|
+
this.triggerFunction = event.detail.textEditor;
|
|
109
|
+
};
|
|
110
|
+
this.handleTriggerStop = (event) => {
|
|
111
|
+
event.stopPropagation();
|
|
112
|
+
this.isPickerOpen = false;
|
|
113
|
+
this.activeTrigger = undefined;
|
|
114
|
+
};
|
|
115
|
+
this.handleTriggerChange = (event) => {
|
|
116
|
+
event.stopImmediatePropagation();
|
|
117
|
+
this.editorPickerQuery = event.detail.value;
|
|
118
|
+
this.search();
|
|
119
|
+
};
|
|
120
|
+
this.handleItemSelected = (event) => {
|
|
121
|
+
this.insertEditorNode(event.detail);
|
|
122
|
+
this.activeTrigger = undefined;
|
|
123
|
+
};
|
|
124
|
+
this.insertEditorNode = (item) => {
|
|
125
|
+
var _a;
|
|
126
|
+
if (this.activeTrigger === undefined) {
|
|
127
|
+
console.warn('No triggerMap found');
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const nodeDefinition = this.triggerMap[this.activeTrigger];
|
|
131
|
+
try {
|
|
132
|
+
(_a = this.triggerFunction) === null || _a === void 0 ? void 0 : _a.insert({
|
|
133
|
+
node: {
|
|
134
|
+
tagName: nodeDefinition.customElement.tagName,
|
|
135
|
+
attributes: nodeDefinition.mapAttributes(item),
|
|
136
|
+
},
|
|
137
|
+
children: [this.activeTrigger + item.text],
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
catch (e) {
|
|
141
|
+
console.error("Can't insert node to the text editor", e);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
this.portalId = createRandomString();
|
|
145
|
+
}
|
|
146
|
+
watchOpen() {
|
|
147
|
+
this.setupGlobalHandlers();
|
|
148
|
+
}
|
|
149
|
+
watchQuery() {
|
|
150
|
+
this.setPickerMessage();
|
|
151
|
+
}
|
|
152
|
+
componentWillLoad() {
|
|
153
|
+
this.setCustomElementsAndTriggers();
|
|
154
|
+
}
|
|
155
|
+
setCustomElementsAndTriggers() {
|
|
156
|
+
const customElements = Object.values(this.triggerMap).map((item) => item.customElement);
|
|
157
|
+
const triggers = Object.keys(this.triggerMap);
|
|
158
|
+
this.customElements = customElements;
|
|
159
|
+
this.registeredTriggers = triggers;
|
|
160
|
+
}
|
|
161
|
+
setPickerMessage() {
|
|
162
|
+
if (this.isPickerOpen === true && this.editorPickerQuery.length > 0) {
|
|
163
|
+
this.pickerMessage = 'No results for your search...';
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
this.pickerMessage = 'Start typing a name...';
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
setupGlobalHandlers() {
|
|
170
|
+
if (this.isPickerOpen) {
|
|
171
|
+
document.addEventListener('click', this.globalClickListener, {
|
|
172
|
+
capture: true,
|
|
173
|
+
});
|
|
174
|
+
document.addEventListener('keyup', this.handleGlobalKeyPress);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
document.removeEventListener('click', this.globalClickListener);
|
|
178
|
+
document.removeEventListener('keyup', this.handleGlobalKeyPress);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
render() {
|
|
182
|
+
return [
|
|
183
|
+
index.h("limel-text-editor", { value: this.value, customElements: this.customElements, triggers: this.registeredTriggers, onTriggerStart: this.handleTriggerStart, onTriggerStop: this.handleTriggerStop, onTriggerChange: this.handleTriggerChange, ui: this.uiType, allowResize: this.allowResize }),
|
|
184
|
+
this.renderPicker(),
|
|
185
|
+
];
|
|
186
|
+
}
|
|
187
|
+
renderPicker() {
|
|
188
|
+
if (!this.isPickerOpen) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
return (index.h("limel-portal", { containerId: this.portalId, visible: this.isPickerOpen, openDirection: "top", inheritParentWidth: true, anchor: this.textEditorElement }, index.h("limebb-text-editor-picker", { items: this.items, onItemSelected: this.handleItemSelected, emptyMessage: this.pickerMessage })));
|
|
192
|
+
}
|
|
193
|
+
async search() {
|
|
194
|
+
if (!this.limeObjectService) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const query = this.editorPickerQuery;
|
|
198
|
+
const limetype = this.coworkerLimetype;
|
|
199
|
+
const limit = SEARCH_LIMIT;
|
|
200
|
+
try {
|
|
201
|
+
const response = await this.limeObjectService.search(query, limetype, limit);
|
|
202
|
+
if (query !== this.editorPickerQuery) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this.items = response.objects.map((object) => {
|
|
206
|
+
return {
|
|
207
|
+
text: object._descriptive,
|
|
208
|
+
secondaryText: object._limetype,
|
|
209
|
+
value: object._id,
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
catch (e) {
|
|
214
|
+
console.error('Failed search for user', e);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
get limeObjectService() {
|
|
218
|
+
return this.platform.get(types.PlatformServiceName.LimeObjectRepository);
|
|
219
|
+
}
|
|
220
|
+
get textEditorElement() { return index.getElement(this); }
|
|
221
|
+
static get watchers() { return {
|
|
222
|
+
"isPickerOpen": ["watchOpen"],
|
|
223
|
+
"editorPickerQuery": ["watchQuery"]
|
|
224
|
+
}; }
|
|
225
|
+
};
|
|
226
|
+
__decorate([
|
|
227
|
+
decorator.SelectLimeTypes({
|
|
228
|
+
map: [findLimetypeByLabel('user')],
|
|
229
|
+
})
|
|
230
|
+
], LimeBBTextEditor.prototype, "coworkerLimetype", void 0);
|
|
231
|
+
|
|
232
|
+
exports.limebb_text_editor = LimeBBTextEditor;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["limebb-feed.cjs",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"lastVisitedTimestamp":[1,"last-visited-timestamp"]}]]],["limebb-kanban.cjs",[[1,"limebb-kanban",{"platform":[16],"context":[16],"items":[16],"paginationSize":[2,"pagination-size"],"groupBy":[513,"group-by"],"groups":[16]}]]],["limebb-date-range.cjs",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format.cjs",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-notification-list.cjs",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]}]]],["limebb-browser.cjs",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["limebb-component-config.cjs",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]}]]],["limebb-component-picker.cjs",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-dashboard-widget.cjs",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["limebb-icon-picker.cjs",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-info-tile.cjs",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]}]]],["limebb-info-tile-date-format.cjs",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["limebb-info-tile-decimal-format.cjs",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["limebb-info-tile-format.cjs",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["limebb-info-tile-relative-date-format.cjs",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["limebb-info-tile-unit-format.cjs",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["limebb-limeobject-file-viewer.cjs",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["limebb-locale-picker.cjs",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["limebb-mention.cjs",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["limebb-navigation-button.cjs",[[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["limebb-
|
|
17
|
+
return index.bootstrapLazy([["limebb-feed.cjs",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"lastVisitedTimestamp":[1,"last-visited-timestamp"]}]]],["limebb-kanban.cjs",[[1,"limebb-kanban",{"platform":[16],"context":[16],"items":[16],"paginationSize":[2,"pagination-size"],"groupBy":[513,"group-by"],"groups":[16]}]]],["limebb-date-range.cjs",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format.cjs",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-notification-list.cjs",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]}]]],["limebb-text-editor.cjs",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"selectedContext":[16],"uiType":[8,"ui-type"],"allowResize":[4,"allow-resize"],"value":[1],"items":[32],"customElements":[32],"registeredTriggers":[32],"editorPickerQuery":[32],"coworkerLimetype":[32],"isPickerOpen":[32]}]]],["limebb-browser.cjs",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["limebb-component-config.cjs",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]}]]],["limebb-component-picker.cjs",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-dashboard-widget.cjs",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["limebb-icon-picker.cjs",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-info-tile.cjs",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]}]]],["limebb-info-tile-date-format.cjs",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["limebb-info-tile-decimal-format.cjs",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["limebb-info-tile-format.cjs",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["limebb-info-tile-relative-date-format.cjs",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["limebb-info-tile-unit-format.cjs",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["limebb-limeobject-file-viewer.cjs",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["limebb-locale-picker.cjs",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["limebb-mention.cjs",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["limebb-navigation-button.cjs",[[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["limebb-kanban-column.cjs",[[1,"limebb-kanban-column",{"platform":[16],"context":[16],"columnHeading":[1,"column-heading"],"items":[16],"loading":[4],"paginationSize":[2,"pagination-size"],"displayedItemCount":[32]}]]],["limebb-currency-picker.cjs",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["limebb-date-picker.cjs",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["limebb-notification-item.cjs",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["limebb-text-editor-picker.cjs",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"emptyMessage":[1,"empty-message"]}]]],["limebb-empty-state_2.cjs",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}],[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["limebb-kanban-item.cjs",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"./components/navigation-button/navigation-button.js",
|
|
28
28
|
"./components/notification-list/notification-list.js",
|
|
29
29
|
"./components/notification-list/notification-item/notification-item.js",
|
|
30
|
-
"./components/text-editor/text-editor-picker.js"
|
|
30
|
+
"./components/text-editor/text-editor-picker.js",
|
|
31
|
+
"./components/text-editor/text-editor.js"
|
|
31
32
|
],
|
|
32
33
|
"compiler": {
|
|
33
34
|
"name": "@stencil/core",
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
:host(limebb-text-editor-picker) {
|
|
2
|
-
animation: fade 0.
|
|
2
|
+
animation: fade-in 0.3s ease forwards;
|
|
3
3
|
animation-delay: 0.1s;
|
|
4
|
-
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
gap: 0.5rem;
|
|
8
|
-
padding: 0.5rem;
|
|
4
|
+
display: block;
|
|
9
5
|
max-width: calc(100vw - 2rem);
|
|
6
|
+
padding: 0.125rem;
|
|
10
7
|
border-radius: 0.5rem;
|
|
11
|
-
background-color: var(--
|
|
8
|
+
background-color: rgba(var(--contrast-100));
|
|
12
9
|
box-shadow: var(--shadow-depth-16);
|
|
13
10
|
}
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
span {
|
|
13
|
+
padding: 0.25rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@keyframes fade-in {
|
|
16
17
|
0% {
|
|
17
|
-
scale: 0.86;
|
|
18
18
|
opacity: 0;
|
|
19
19
|
}
|
|
20
20
|
100% {
|
|
21
|
-
scale: 1;
|
|
22
21
|
opacity: 1;
|
|
23
22
|
}
|
|
24
23
|
}
|
|
@@ -24,6 +24,7 @@ export class TextEditorPicker {
|
|
|
24
24
|
* Open state of the link-menu dialog
|
|
25
25
|
*/
|
|
26
26
|
this.open = false;
|
|
27
|
+
this.emptyMessage = '';
|
|
27
28
|
this.handleCancel = (event) => {
|
|
28
29
|
if (event instanceof KeyboardEvent && event.key !== ESCAPE) {
|
|
29
30
|
return;
|
|
@@ -60,7 +61,12 @@ export class TextEditorPicker {
|
|
|
60
61
|
document.removeEventListener('keyup', this.handleCancel);
|
|
61
62
|
}
|
|
62
63
|
render() {
|
|
63
|
-
|
|
64
|
+
if (this.items.length === 0) {
|
|
65
|
+
return h("span", null, this.emptyMessage);
|
|
66
|
+
}
|
|
67
|
+
return [
|
|
68
|
+
h("limel-list", { type: "selectable", items: this.items, onChange: this.selectOnChange }),
|
|
69
|
+
];
|
|
64
70
|
}
|
|
65
71
|
static get is() { return "limebb-text-editor-picker"; }
|
|
66
72
|
static get encapsulation() { return "shadow"; }
|
|
@@ -121,6 +127,24 @@ export class TextEditorPicker {
|
|
|
121
127
|
"attribute": "open",
|
|
122
128
|
"reflect": true,
|
|
123
129
|
"defaultValue": "false"
|
|
130
|
+
},
|
|
131
|
+
"emptyMessage": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "string",
|
|
136
|
+
"resolved": "string",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": ""
|
|
144
|
+
},
|
|
145
|
+
"attribute": "empty-message",
|
|
146
|
+
"reflect": false,
|
|
147
|
+
"defaultValue": "''"
|
|
124
148
|
}
|
|
125
149
|
};
|
|
126
150
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|