@cortezaproject/corteza-vue 2024.9.6-dev.1 → 2024.9.6-dev.2
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/dist/index.cjs +274 -90
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +274 -90
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/components/c3/C3.d.ts +0 -5
- package/dist/components/filePreview/common/index.d.ts +0 -2
- package/dist/components/filePreview/common/types/PDF/helpers.d.ts +0 -53
- package/dist/components/filePreview/common/types/index.d.ts +0 -3
- package/dist/components/input/CRichTextInput/RToolbar/TMark/loader.d.ts +0 -10
- package/dist/components/input/CRichTextInput/RToolbar/TNode/loader.d.ts +0 -6
- package/dist/components/input/CRichTextInput/RToolbar/TNodeAttr/loader.d.ts +0 -6
- package/dist/components/input/CRichTextInput/RToolbar/loader.d.ts +0 -9
- package/dist/components/input/CRichTextInput/extensions/heading.d.ts +0 -12
- package/dist/components/input/CRichTextInput/extensions/htmlPaster.d.ts +0 -4
- package/dist/components/input/CRichTextInput/extensions/index.d.ts +0 -6
- package/dist/components/input/CRichTextInput/extensions/link.d.ts +0 -6
- package/dist/components/input/CRichTextInput/extensions/paragraph.d.ts +0 -9
- package/dist/components/input/CRichTextInput/extensions/textBackground.d.ts +0 -23
- package/dist/components/input/CRichTextInput/extensions/textColor.d.ts +0 -23
- package/dist/components/input/CRichTextInput/extensions/utils.d.ts +0 -15
- package/dist/components/input/CRichTextInput/lib/formats.d.ts +0 -85
- package/dist/components/input/CRichTextInput/lib/index.d.ts +0 -1
- package/dist/components/itemPicker/C3.d.ts +0 -1
- package/dist/components/itemPicker/CItemPicker.c3.d.ts +0 -32
- package/dist/components/toaster/actions/index.d.ts +0 -3
- package/dist/mixins/corredor.d.ts +0 -49
- package/dist/mixins/files.d.ts +0 -19
- package/dist/mixins/vue-select-position.d.ts +0 -11
- package/dist/node_modules/@tiptap/pm/state/index.d.ts +0 -1
- package/dist/plugins/reminder.d.ts +0 -66
- package/dist/plugins/settings.d.ts +0 -27
package/dist/index.cjs
CHANGED
|
@@ -8581,8 +8581,6 @@ const __vue_script__$16 = script$16;
|
|
|
8581
8581
|
//
|
|
8582
8582
|
//
|
|
8583
8583
|
//
|
|
8584
|
-
//
|
|
8585
|
-
//
|
|
8586
8584
|
|
|
8587
8585
|
|
|
8588
8586
|
var script$15 = {
|
|
@@ -8607,12 +8605,6 @@ var script$15 = {
|
|
|
8607
8605
|
}
|
|
8608
8606
|
},
|
|
8609
8607
|
|
|
8610
|
-
computed: {
|
|
8611
|
-
typeStyle () {
|
|
8612
|
-
return `${this.format.type}-icon`
|
|
8613
|
-
},
|
|
8614
|
-
},
|
|
8615
|
-
|
|
8616
8608
|
methods: {
|
|
8617
8609
|
getComputedColor (cssVar) {
|
|
8618
8610
|
try {
|
|
@@ -8645,24 +8637,22 @@ var script$15 = {
|
|
|
8645
8637
|
const __vue_script__$15 = script$15;
|
|
8646
8638
|
|
|
8647
8639
|
/* template */
|
|
8648
|
-
var __vue_render__$12 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-button',{staticClass:"text-dark font-weight-bold text-decoration-none",attrs:{"id":("color-popover-" + (_vm.format.type)),"variant":"link"},on:{"click":function($event){$event.stopPropagation();$event.preventDefault();return _vm.showPicker.apply(null, arguments)}}},[_c('span',{
|
|
8640
|
+
var __vue_render__$12 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-button',{staticClass:"text-dark font-weight-bold text-decoration-none mb-1",attrs:{"id":("color-popover-" + (_vm.format.type)),"variant":"link"},on:{"click":function($event){$event.stopPropagation();$event.preventDefault();return _vm.showPicker.apply(null, arguments)}}},[_c('span',{style:({
|
|
8649
8641
|
backgroundColor: _vm.background ? _vm.selectedColor : 'transparent',
|
|
8650
|
-
|
|
8642
|
+
'border-bottom': _vm.background ? 'none' : ("2px solid " + _vm.selectedColor),
|
|
8651
8643
|
})},[_vm._v("\n A\n ")])]),_vm._v(" "),_c('c-input-color-picker',{ref:"picker",staticClass:"d-none",attrs:{"value":_vm.selectedColor,"default-value":_vm.getDefaultColor(),"show-text":false,"width":'0px',"height":'0px'},on:{"input":_vm.applyFromPicker}})],1)};
|
|
8652
8644
|
var __vue_staticRenderFns__$12 = [];
|
|
8653
8645
|
|
|
8654
8646
|
/* style */
|
|
8655
|
-
const __vue_inject_styles__$16 =
|
|
8656
|
-
if (!inject) return
|
|
8657
|
-
inject("data-v-f18be530_0", { source: ".icon[data-v-f18be530]{padding:0 2px}.icon.color-icon[data-v-f18be530]{border-bottom:2px solid var(--dark)}.icon.background-icon[data-v-f18be530]{padding:2px 3px}", map: undefined, media: undefined });
|
|
8658
|
-
|
|
8659
|
-
};
|
|
8647
|
+
const __vue_inject_styles__$16 = undefined;
|
|
8660
8648
|
/* scoped */
|
|
8661
|
-
const __vue_scope_id__$16 =
|
|
8649
|
+
const __vue_scope_id__$16 = undefined;
|
|
8662
8650
|
/* module identifier */
|
|
8663
8651
|
const __vue_module_identifier__$16 = undefined;
|
|
8664
8652
|
/* functional template */
|
|
8665
8653
|
const __vue_is_functional_template__$16 = false;
|
|
8654
|
+
/* style inject */
|
|
8655
|
+
|
|
8666
8656
|
/* style inject SSR */
|
|
8667
8657
|
|
|
8668
8658
|
/* style inject shadow dom */
|
|
@@ -8677,7 +8667,7 @@ var __vue_staticRenderFns__$12 = [];
|
|
|
8677
8667
|
__vue_is_functional_template__$16,
|
|
8678
8668
|
__vue_module_identifier__$16,
|
|
8679
8669
|
false,
|
|
8680
|
-
|
|
8670
|
+
undefined);
|
|
8681
8671
|
|
|
8682
8672
|
//
|
|
8683
8673
|
//
|
|
@@ -9097,11 +9087,11 @@ var suggestion = {
|
|
|
9097
9087
|
}
|
|
9098
9088
|
});
|
|
9099
9089
|
};
|
|
9100
|
-
popup.addEventListener('click', function (
|
|
9101
|
-
return handleSelection
|
|
9090
|
+
popup.addEventListener('click', function () {
|
|
9091
|
+
return handleSelection;
|
|
9102
9092
|
});
|
|
9103
|
-
popup.addEventListener('mouseup', function (
|
|
9104
|
-
return handleSelection
|
|
9093
|
+
popup.addEventListener('mouseup', function () {
|
|
9094
|
+
return handleSelection;
|
|
9105
9095
|
});
|
|
9106
9096
|
popperInstance = core.createPopper(virtualElement, popup, {
|
|
9107
9097
|
placement: 'bottom-start',
|
|
@@ -10294,6 +10284,9 @@ var __vue_staticRenderFns__$V = [];
|
|
|
10294
10284
|
//
|
|
10295
10285
|
//
|
|
10296
10286
|
//
|
|
10287
|
+
//
|
|
10288
|
+
//
|
|
10289
|
+
//
|
|
10297
10290
|
|
|
10298
10291
|
|
|
10299
10292
|
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faExpandAlt);
|
|
@@ -10314,9 +10307,9 @@ var script$W = {
|
|
|
10314
10307
|
default: 'text',
|
|
10315
10308
|
},
|
|
10316
10309
|
|
|
10317
|
-
|
|
10310
|
+
minHeight: {
|
|
10318
10311
|
type: String,
|
|
10319
|
-
default: '
|
|
10312
|
+
default: '2.35rem',
|
|
10320
10313
|
},
|
|
10321
10314
|
|
|
10322
10315
|
showLineNumbers: {
|
|
@@ -10378,6 +10371,21 @@ var script$W = {
|
|
|
10378
10371
|
type: String,
|
|
10379
10372
|
default: '',
|
|
10380
10373
|
},
|
|
10374
|
+
|
|
10375
|
+
resizable: {
|
|
10376
|
+
type: Boolean,
|
|
10377
|
+
default: false,
|
|
10378
|
+
},
|
|
10379
|
+
},
|
|
10380
|
+
|
|
10381
|
+
data () {
|
|
10382
|
+
return {
|
|
10383
|
+
resizeObserver: null,
|
|
10384
|
+
manualHeight: null,
|
|
10385
|
+
contentHeight: null,
|
|
10386
|
+
programmaticUpdate: false,
|
|
10387
|
+
resizeTimeout: null,
|
|
10388
|
+
}
|
|
10381
10389
|
},
|
|
10382
10390
|
|
|
10383
10391
|
computed: {
|
|
@@ -10390,9 +10398,144 @@ var script$W = {
|
|
|
10390
10398
|
this.$emit('update:value', value);
|
|
10391
10399
|
},
|
|
10392
10400
|
},
|
|
10401
|
+
|
|
10402
|
+
containerStyle () {
|
|
10403
|
+
if (this.resizable) {
|
|
10404
|
+
return {
|
|
10405
|
+
minHeight: this.minHeight,
|
|
10406
|
+
height: this.effectiveHeight,
|
|
10407
|
+
}
|
|
10408
|
+
}
|
|
10409
|
+
return {}
|
|
10410
|
+
},
|
|
10411
|
+
|
|
10412
|
+
effectiveHeight () {
|
|
10413
|
+
if (this.resizable) {
|
|
10414
|
+
// Use the larger of manual height, content height, or minimum height
|
|
10415
|
+
const manualHeightPx = this.manualHeight ? this.parseHeight(this.manualHeight) : 0;
|
|
10416
|
+
const contentHeightPx = this.contentHeight ? this.parseHeight(this.contentHeight) : 0;
|
|
10417
|
+
const minHeightPx = this.parseHeight(this.minHeight);
|
|
10418
|
+
|
|
10419
|
+
const maxHeight = Math.max(manualHeightPx, contentHeightPx, minHeightPx);
|
|
10420
|
+
return `${maxHeight}px`
|
|
10421
|
+
}
|
|
10422
|
+
return this.minHeight
|
|
10423
|
+
},
|
|
10424
|
+
},
|
|
10425
|
+
|
|
10426
|
+
watch: {
|
|
10427
|
+
value () {
|
|
10428
|
+
if (this.resizable && this.$refs.aceeditor && this.$refs.aceeditor.editor) {
|
|
10429
|
+
this.$nextTick(() => {
|
|
10430
|
+
this.calculateContentHeight(this.$refs.aceeditor.editor);
|
|
10431
|
+
});
|
|
10432
|
+
}
|
|
10433
|
+
},
|
|
10434
|
+
},
|
|
10435
|
+
|
|
10436
|
+
mounted () {
|
|
10437
|
+
if (this.resizable) {
|
|
10438
|
+
this.setupResizeObserver();
|
|
10439
|
+
}
|
|
10440
|
+
},
|
|
10441
|
+
|
|
10442
|
+
beforeDestroy () {
|
|
10443
|
+
if (this.resizeObserver) {
|
|
10444
|
+
this.resizeObserver.disconnect();
|
|
10445
|
+
}
|
|
10446
|
+
if (this.resizeTimeout) {
|
|
10447
|
+
clearTimeout(this.resizeTimeout);
|
|
10448
|
+
}
|
|
10393
10449
|
},
|
|
10394
10450
|
|
|
10395
10451
|
methods: {
|
|
10452
|
+
parseHeight (height) {
|
|
10453
|
+
if (typeof height === 'number') return height
|
|
10454
|
+
if (typeof height === 'string') {
|
|
10455
|
+
// Remove 'px' and parse to number
|
|
10456
|
+
return parseFloat(height.replace('px', '').replace('rem', '')) * (height.includes('rem') ? 16 : 1)
|
|
10457
|
+
}
|
|
10458
|
+
return 0
|
|
10459
|
+
},
|
|
10460
|
+
|
|
10461
|
+
calculateContentHeight (editor) {
|
|
10462
|
+
if (!editor) return
|
|
10463
|
+
|
|
10464
|
+
const session = editor.session;
|
|
10465
|
+
const lineCount = session.getLength();
|
|
10466
|
+
const lineHeight = editor.renderer.lineHeight || 16;
|
|
10467
|
+
const padding = 14; // Top and bottom padding
|
|
10468
|
+
|
|
10469
|
+
const contentHeight = (lineCount * lineHeight) + padding;
|
|
10470
|
+
|
|
10471
|
+
// Parse minHeight to ensure we don't go below it
|
|
10472
|
+
const minHeightPx = this.parseHeight(this.minHeight);
|
|
10473
|
+
const finalHeight = Math.max(contentHeight, minHeightPx);
|
|
10474
|
+
|
|
10475
|
+
// Set flag to prevent ResizeObserver from reacting to this change
|
|
10476
|
+
this.programmaticUpdate = true;
|
|
10477
|
+
this.contentHeight = `${finalHeight}px`;
|
|
10478
|
+
|
|
10479
|
+
// Clear the flag after a short delay
|
|
10480
|
+
this.$nextTick(() => {
|
|
10481
|
+
setTimeout(() => {
|
|
10482
|
+
this.programmaticUpdate = false;
|
|
10483
|
+
}, 50);
|
|
10484
|
+
});
|
|
10485
|
+
},
|
|
10486
|
+
|
|
10487
|
+
setupResizeObserver () {
|
|
10488
|
+
let lastHeight = null;
|
|
10489
|
+
let isInitialized = false;
|
|
10490
|
+
|
|
10491
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
10492
|
+
// Skip if we're in the middle of a programmatic update
|
|
10493
|
+
if (this.programmaticUpdate) {
|
|
10494
|
+
return
|
|
10495
|
+
}
|
|
10496
|
+
|
|
10497
|
+
for (const entry of entries) {
|
|
10498
|
+
const newHeight = entry.contentRect.height;
|
|
10499
|
+
|
|
10500
|
+
// Skip the first observation (initialization)
|
|
10501
|
+
if (!isInitialized) {
|
|
10502
|
+
lastHeight = newHeight;
|
|
10503
|
+
isInitialized = true;
|
|
10504
|
+
return
|
|
10505
|
+
}
|
|
10506
|
+
|
|
10507
|
+
// Only update if height actually changed significantly (more than 2px to avoid rounding issues)
|
|
10508
|
+
if (lastHeight !== null && Math.abs(lastHeight - newHeight) > 2) {
|
|
10509
|
+
// Clear any pending timeout
|
|
10510
|
+
if (this.resizeTimeout) {
|
|
10511
|
+
clearTimeout(this.resizeTimeout);
|
|
10512
|
+
}
|
|
10513
|
+
|
|
10514
|
+
// Debounce the update slightly to prevent flickering
|
|
10515
|
+
this.resizeTimeout = setTimeout(() => {
|
|
10516
|
+
this.manualHeight = `${newHeight}px`;
|
|
10517
|
+
this.updateEditorSize();
|
|
10518
|
+
lastHeight = newHeight;
|
|
10519
|
+
}, 10);
|
|
10520
|
+
}
|
|
10521
|
+
}
|
|
10522
|
+
});
|
|
10523
|
+
|
|
10524
|
+
if (this.$refs.container) {
|
|
10525
|
+
this.resizeObserver.observe(this.$refs.container);
|
|
10526
|
+
}
|
|
10527
|
+
},
|
|
10528
|
+
|
|
10529
|
+
updateEditorSize () {
|
|
10530
|
+
// Force ace editor to resize
|
|
10531
|
+
this.$nextTick(() => {
|
|
10532
|
+
if (this.$refs.aceeditor && this.$refs.aceeditor.editor) {
|
|
10533
|
+
const editor = this.$refs.aceeditor.editor;
|
|
10534
|
+
editor.resize();
|
|
10535
|
+
}
|
|
10536
|
+
});
|
|
10537
|
+
},
|
|
10538
|
+
|
|
10396
10539
|
editorInit (editor) {
|
|
10397
10540
|
Promise.resolve().then(function () { return text$1; });
|
|
10398
10541
|
Promise.resolve().then(function () { return html$1; });
|
|
@@ -10400,7 +10543,6 @@ var script$W = {
|
|
|
10400
10543
|
Promise.resolve().then(function () { return scss$1; });
|
|
10401
10544
|
Promise.resolve().then(function () { return json$1; });
|
|
10402
10545
|
Promise.resolve().then(function () { return javascript$1; });
|
|
10403
|
-
Promise.resolve().then(function () { return json$1; });
|
|
10404
10546
|
|
|
10405
10547
|
Promise.resolve().then(function () { return text; });
|
|
10406
10548
|
Promise.resolve().then(function () { return html; });
|
|
@@ -10408,7 +10550,6 @@ var script$W = {
|
|
|
10408
10550
|
Promise.resolve().then(function () { return scss; });
|
|
10409
10551
|
Promise.resolve().then(function () { return json; });
|
|
10410
10552
|
Promise.resolve().then(function () { return javascript; });
|
|
10411
|
-
Promise.resolve().then(function () { return json; });
|
|
10412
10553
|
|
|
10413
10554
|
Promise.resolve().then(function () { return chrome; });
|
|
10414
10555
|
Promise.resolve().then(function () { return language_tools; });
|
|
@@ -10427,8 +10568,6 @@ var script$W = {
|
|
|
10427
10568
|
readOnly: this.readOnly,
|
|
10428
10569
|
highlightActiveLine: this.highlightActiveLine,
|
|
10429
10570
|
cursorStyle: 'smooth',
|
|
10430
|
-
// // minLines: this.height,
|
|
10431
|
-
// maxPixelHeight: 100,
|
|
10432
10571
|
|
|
10433
10572
|
...(this.autoComplete && {
|
|
10434
10573
|
enableBasicAutocompletion: true,
|
|
@@ -10444,6 +10583,19 @@ var script$W = {
|
|
|
10444
10583
|
editor.on('input', this.updatePlaceholder);
|
|
10445
10584
|
this.updatePlaceholder(undefined, editor);
|
|
10446
10585
|
|
|
10586
|
+
// Calculate initial content height and listen for changes if resizable
|
|
10587
|
+
if (this.resizable) {
|
|
10588
|
+
// Calculate initial height
|
|
10589
|
+
this.$nextTick(() => {
|
|
10590
|
+
this.calculateContentHeight(editor);
|
|
10591
|
+
});
|
|
10592
|
+
|
|
10593
|
+
// Recalculate on content change
|
|
10594
|
+
editor.session.on('change', () => {
|
|
10595
|
+
this.calculateContentHeight(editor);
|
|
10596
|
+
});
|
|
10597
|
+
}
|
|
10598
|
+
|
|
10447
10599
|
if (this.initExpressions) {
|
|
10448
10600
|
this.processExpressionAutoComplete(editor);
|
|
10449
10601
|
} else if (this.autoComplete) {
|
|
@@ -10487,55 +10639,95 @@ var script$W = {
|
|
|
10487
10639
|
},
|
|
10488
10640
|
|
|
10489
10641
|
processExpressionAutoComplete (editor) {
|
|
10642
|
+
// Extract text context from current cursor position
|
|
10643
|
+
const getTextContext = (pos) => {
|
|
10644
|
+
const session = editor.session;
|
|
10645
|
+
const line = session.getLine(pos.row);
|
|
10646
|
+
const lastSpaceIndex = Math.max(0, line.lastIndexOf(' '));
|
|
10647
|
+
const textAfterSpace = line.slice(lastSpaceIndex, pos.column).trim();
|
|
10648
|
+
const lastDotIndex = textAfterSpace.lastIndexOf('.');
|
|
10649
|
+
const searchTextForCaption = lastDotIndex >= 0 ? textAfterSpace.slice(lastDotIndex + 1) : textAfterSpace;
|
|
10650
|
+
|
|
10651
|
+
return { line, textAfterSpace, searchTextForCaption }
|
|
10652
|
+
};
|
|
10653
|
+
|
|
10654
|
+
// Check if suggestion matches search text
|
|
10655
|
+
const matchesSuggestion = (suggestion, textAfterSpace, searchTextForCaption) => {
|
|
10656
|
+
const suggestionValue = typeof suggestion === 'string' ? suggestion : suggestion.value;
|
|
10657
|
+
const suggestionCaption = typeof suggestion === 'string' ? suggestion : suggestion.caption;
|
|
10658
|
+
return suggestionValue.toLowerCase().startsWith(textAfterSpace.toLowerCase()) ||
|
|
10659
|
+
suggestionCaption.toLowerCase().startsWith(searchTextForCaption.toLowerCase())
|
|
10660
|
+
};
|
|
10661
|
+
|
|
10662
|
+
// Check and trigger autocomplete if there are matching suggestions
|
|
10663
|
+
const checkAndTriggerAutocomplete = () => {
|
|
10664
|
+
setTimeout(() => {
|
|
10665
|
+
const pos = editor.getCursorPosition();
|
|
10666
|
+
const { line, textAfterSpace, searchTextForCaption } = getTextContext(pos);
|
|
10667
|
+
|
|
10668
|
+
// Don't trigger after closing braces
|
|
10669
|
+
const charBeforeCursor = pos.column > 0 ? line[pos.column - 1] : '';
|
|
10670
|
+
if (charBeforeCursor === '}' || charBeforeCursor === ')' || textAfterSpace.length === 0) {
|
|
10671
|
+
return
|
|
10672
|
+
}
|
|
10673
|
+
|
|
10674
|
+
const context = this.getContext(editor, editor.session, pos);
|
|
10675
|
+
const suggestions = this.getSuggestionsForContext(context);
|
|
10676
|
+
const hasMatches = suggestions.some(s => matchesSuggestion(s, textAfterSpace, searchTextForCaption));
|
|
10677
|
+
|
|
10678
|
+
if (hasMatches) {
|
|
10679
|
+
editor.execCommand('startAutocomplete');
|
|
10680
|
+
}
|
|
10681
|
+
}, 10);
|
|
10682
|
+
};
|
|
10683
|
+
|
|
10490
10684
|
const staticWordCompleter = {
|
|
10685
|
+
identifierRegexps: [/[${\w]+/],
|
|
10491
10686
|
getCompletions: (editor, session, pos, prefix, callback) => {
|
|
10492
10687
|
const context = this.getContext(editor, session, pos);
|
|
10493
10688
|
const suggestions = this.getSuggestionsForContext(context);
|
|
10494
|
-
|
|
10495
|
-
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
}
|
|
10522
|
-
|
|
10523
|
-
insertEditor.session.replace({
|
|
10524
|
-
start: { row: pos.row, column: lastSpaceIndex },
|
|
10525
|
-
end: { row: pos.row, column: pos.column },
|
|
10526
|
-
}, insertValue);
|
|
10689
|
+
const { textAfterSpace, searchTextForCaption } = getTextContext(pos);
|
|
10690
|
+
|
|
10691
|
+
const filteredSuggestions = suggestions
|
|
10692
|
+
.filter(s => matchesSuggestion(s, textAfterSpace, searchTextForCaption))
|
|
10693
|
+
.map(suggestion => {
|
|
10694
|
+
const caption = typeof suggestion === 'string' ? suggestion : suggestion.caption;
|
|
10695
|
+
const value = typeof suggestion === 'string' ? suggestion : suggestion.value;
|
|
10696
|
+
const captionMatch = caption.toLowerCase().indexOf(searchTextForCaption.toLowerCase());
|
|
10697
|
+
|
|
10698
|
+
return {
|
|
10699
|
+
caption,
|
|
10700
|
+
value,
|
|
10701
|
+
score: captionMatch === 0 ? 10000 : 1000,
|
|
10702
|
+
meta: 'variable',
|
|
10703
|
+
completer: {
|
|
10704
|
+
insertMatch: (insertEditor, data) => {
|
|
10705
|
+
insertEditor.jumpToMatching();
|
|
10706
|
+
const line = session.getLine(pos.row);
|
|
10707
|
+
const spaceIndex = line.lastIndexOf(' ');
|
|
10708
|
+
const startCol = spaceIndex > 0 ? spaceIndex + 1 : 0;
|
|
10709
|
+
|
|
10710
|
+
insertEditor.session.replace({
|
|
10711
|
+
start: { row: pos.row, column: startCol },
|
|
10712
|
+
end: { row: pos.row, column: pos.column },
|
|
10713
|
+
}, data.value);
|
|
10714
|
+
|
|
10715
|
+
checkAndTriggerAutocomplete();
|
|
10716
|
+
},
|
|
10527
10717
|
},
|
|
10528
|
-
}
|
|
10529
|
-
}
|
|
10530
|
-
|
|
10718
|
+
}
|
|
10719
|
+
});
|
|
10720
|
+
|
|
10721
|
+
callback(null, filteredSuggestions);
|
|
10531
10722
|
},
|
|
10532
10723
|
};
|
|
10533
10724
|
|
|
10534
10725
|
editor.completers = [staticWordCompleter];
|
|
10535
10726
|
|
|
10536
|
-
|
|
10727
|
+
// Only trigger autocomplete automatically when there's a partial match
|
|
10728
|
+
editor.commands.on('afterExec', (e) => {
|
|
10537
10729
|
if (['insertstring', 'Return'].includes(e.command.name) || /^[\w.($]$/.test(e.args)) {
|
|
10538
|
-
|
|
10730
|
+
checkAndTriggerAutocomplete();
|
|
10539
10731
|
}
|
|
10540
10732
|
});
|
|
10541
10733
|
|
|
@@ -10545,17 +10737,13 @@ var script$W = {
|
|
|
10545
10737
|
|
|
10546
10738
|
getContext (editor, session, pos) {
|
|
10547
10739
|
const line = session.getLine(pos.row);
|
|
10548
|
-
const lastSpaceIndex =
|
|
10549
|
-
const textBeforeCursor = line.slice(lastSpaceIndex, pos.column);
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
return context
|
|
10740
|
+
const lastSpaceIndex = Math.max(0, line.lastIndexOf(' '));
|
|
10741
|
+
const textBeforeCursor = line.slice(lastSpaceIndex, pos.column).trim();
|
|
10742
|
+
return textBeforeCursor.split('.').slice(0, -1).join('.')
|
|
10553
10743
|
},
|
|
10554
10744
|
|
|
10555
10745
|
getSuggestionsForContext (context) {
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
return suggestions[context] || []
|
|
10746
|
+
return this.autoCompleteSuggestions[context] || []
|
|
10559
10747
|
},
|
|
10560
10748
|
},
|
|
10561
10749
|
};
|
|
@@ -10564,18 +10752,18 @@ var script$W = {
|
|
|
10564
10752
|
const __vue_script__$W = script$W;
|
|
10565
10753
|
|
|
10566
10754
|
/* template */
|
|
10567
|
-
var __vue_render__$U = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative"},[_c('ace-editor',_vm._g({ref:"aceeditor",class:{ 'border-0 rounded-0': !_vm.border },attrs:{"lang":_vm.lang,"mode":_vm.lang,"theme":"chrome","width":"100%","height":_vm.
|
|
10755
|
+
var __vue_render__$U = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"container",staticClass:"position-relative ace-editor-wrapper",class:{ 'resizable': _vm.resizable },style:(_vm.containerStyle)},[_c('ace-editor',_vm._g({ref:"aceeditor",class:{ 'border-0 rounded-0': !_vm.border },attrs:{"lang":_vm.lang,"mode":_vm.lang,"theme":"chrome","width":"100%","height":_vm.effectiveHeight},on:{"init":_vm.editorInit},model:{value:(_vm.editorValue),callback:function ($$v) {_vm.editorValue=$$v;},expression:"editorValue"}},_vm.$listeners)),_vm._v(" "),(_vm.showPopout)?_c('b-button',{staticClass:"popout position-absolute px-2 py-1 mr-3",attrs:{"variant":"link"},on:{"click":function($event){return _vm.$emit('open')}}},[_c('font-awesome-icon',{attrs:{"icon":['fas', 'expand-alt']}})],1):_vm._e()],1)};
|
|
10568
10756
|
var __vue_staticRenderFns__$U = [];
|
|
10569
10757
|
|
|
10570
10758
|
/* style */
|
|
10571
10759
|
const __vue_inject_styles__$X = function (inject) {
|
|
10572
10760
|
if (!inject) return
|
|
10573
|
-
inject("data-v-
|
|
10574
|
-
,inject("data-v-
|
|
10761
|
+
inject("data-v-00e2204c_0", { source: ".popout[data-v-00e2204c]{z-index:7;bottom:0;right:0}.ace-editor-wrapper.resizable[data-v-00e2204c]{resize:vertical;overflow:auto}.ace-editor-wrapper.resizable .ace_editor[data-v-00e2204c]{height:100%!important}", map: undefined, media: undefined })
|
|
10762
|
+
,inject("data-v-00e2204c_1", { source: ".ace_editor{color:var(--black)!important;background-color:var(--white)!important;border-radius:.25rem;border:2px solid var(--extra-light);font-size:initial!important}.ace_editor .ace_gutter{background-color:var(--light)!important;color:var(--black)!important}.ace_editor .ace_gutter .ace_gutter-active-line{background-color:var(--extra-light)!important}.ace_editor .ace_hidden-cursors .ace_cursor{color:var(--white)!important}.ace_editor .ace_cursor{color:var(--black)!important}.ace_autocomplete{border:none!important}.ace_autocomplete .ace_active-line{background-color:var(--extra-light)!important}.ace_autocomplete .ace_line-hover{border:none!important;background-color:var(--extra-light)!important}.ace_autocomplete .ace_completion-highlight{color:var(--primary)!important}", map: undefined, media: undefined });
|
|
10575
10763
|
|
|
10576
10764
|
};
|
|
10577
10765
|
/* scoped */
|
|
10578
|
-
const __vue_scope_id__$X = "data-v-
|
|
10766
|
+
const __vue_scope_id__$X = "data-v-00e2204c";
|
|
10579
10767
|
/* module identifier */
|
|
10580
10768
|
const __vue_module_identifier__$X = undefined;
|
|
10581
10769
|
/* functional template */
|
|
@@ -10629,9 +10817,9 @@ var script$V = {
|
|
|
10629
10817
|
default: 'text',
|
|
10630
10818
|
},
|
|
10631
10819
|
|
|
10632
|
-
|
|
10820
|
+
minHeight: {
|
|
10633
10821
|
type: String,
|
|
10634
|
-
default: '
|
|
10822
|
+
default: '2.35rem',
|
|
10635
10823
|
},
|
|
10636
10824
|
|
|
10637
10825
|
showLineNumbers: {
|
|
@@ -10683,6 +10871,11 @@ var script$V = {
|
|
|
10683
10871
|
type: String,
|
|
10684
10872
|
default: '',
|
|
10685
10873
|
},
|
|
10874
|
+
|
|
10875
|
+
resizable: {
|
|
10876
|
+
type: Boolean,
|
|
10877
|
+
default: true,
|
|
10878
|
+
},
|
|
10686
10879
|
},
|
|
10687
10880
|
|
|
10688
10881
|
computed: {
|
|
@@ -11287,7 +11480,7 @@ var script$R = {
|
|
|
11287
11480
|
return this.$SystemAPI
|
|
11288
11481
|
.userGroupList(this.userGroup.filter)
|
|
11289
11482
|
.then(({ set }) => {
|
|
11290
|
-
this.userGroup.options = set.map((m) =>
|
|
11483
|
+
this.userGroup.options = set.map((m) => new cortezaJs.system.UserGroup(m));
|
|
11291
11484
|
})
|
|
11292
11485
|
.finally(() => {
|
|
11293
11486
|
setTimeout(() => {
|
|
@@ -11298,9 +11491,7 @@ var script$R = {
|
|
|
11298
11491
|
|
|
11299
11492
|
getUserGroupByID (userGroupID) {
|
|
11300
11493
|
if (!userGroupID || userGroupID === cortezaJs.NoID) {
|
|
11301
|
-
this.userGroup.value = this.userGroup.options.find(
|
|
11302
|
-
({ selfID }) => selfID === cortezaJs.NoID,
|
|
11303
|
-
);
|
|
11494
|
+
this.userGroup.value = this.userGroup.options.find(({ isRoot }) => !!isRoot);
|
|
11304
11495
|
|
|
11305
11496
|
this.$emit('input', this.userGroup.value?.userGroupID);
|
|
11306
11497
|
return
|
|
@@ -11310,13 +11501,6 @@ var script$R = {
|
|
|
11310
11501
|
|
|
11311
11502
|
if (userGroup) {
|
|
11312
11503
|
this.userGroup.value = userGroup;
|
|
11313
|
-
} else {
|
|
11314
|
-
return this.$SystemAPI.userGroupRead({ userGroupID }).then((userGroup) => {
|
|
11315
|
-
this.userGroup.options.push(Object.freeze(userGroup));
|
|
11316
|
-
this.userGroup.value = this.userGroup.options.find(
|
|
11317
|
-
({ selfID }) => selfID === cortezaJs.NoID,
|
|
11318
|
-
);
|
|
11319
|
-
})
|
|
11320
11504
|
}
|
|
11321
11505
|
},
|
|
11322
11506
|
|