@fusion.dev/helix-core 0.26.0 → 0.30.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/custom-elements.json +833 -114
- package/dist/controllers/chart-pointer-controller/chart-pointer-controller.d.ts +23 -1
- package/dist/controllers/chart-pointer-controller/chart-pointer-controller.js +23 -26
- package/dist/controllers/dismiss-controller/dismiss-controller.d.ts +27 -0
- package/dist/controllers/dismiss-controller/dismiss-controller.js +17 -2
- package/dist/controllers/floating-controller/floating-controller.d.ts +13 -0
- package/dist/controllers/floating-controller/floating-controller.js +3 -1
- package/dist/controllers/indicator-controller/indicator-controller.d.ts +16 -0
- package/dist/controllers/indicator-controller/indicator-controller.js +7 -0
- package/dist/controllers/popover-controller/popover-controller.d.ts +22 -0
- package/dist/controllers/popover-controller/popover-controller.js +12 -0
- package/dist/controllers/source-controller/source-controller.d.ts +45 -3
- package/dist/controllers/source-controller/source-controller.js +33 -21
- package/dist/helix-element/helix-element.d.ts +19 -0
- package/dist/helix-element/helix-element.js +5 -94
- package/dist/helix-element/react-bridge.d.ts +104 -0
- package/dist/helix-element/react-bridge.js +94 -0
- package/dist/helix-form-element/helix-form-element.d.ts +19 -0
- package/dist/helix-form-element/helix-form-element.js +6 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/mixins/mixin-chart-source/mixin-chart-source.d.ts +1 -1
- package/dist/mixins/mixin-chart-source/mixin-chart-source.js +2 -5
- package/dist/mixins/mixin-controller-value/mixin-controller-value.js +2 -2
- package/dist/mixins/mixin-field/mixin-field.js +2 -2
- package/dist/mixins/mixin-picker-editing/mixin-picker-editing.d.ts +48 -0
- package/dist/mixins/mixin-picker-editing/mixin-picker-editing.js +43 -0
- package/dist/mixins/mixin-picker-field/mixin-picker-field.d.ts +118 -0
- package/dist/mixins/mixin-picker-field/mixin-picker-field.js +79 -0
- package/dist/utils/draw-icon/draw-icon.d.ts +1 -1
- package/dist/utils/draw-tooltip/draw-tooltip.js +1 -0
- package/package.json +4 -4
- package/dist/mixins/mixin-collection/index.d.ts +0 -1
- package/dist/mixins/mixin-collection/index.js +0 -1
- package/dist/utils/close-markdown/close-markdown.d.ts +0 -39
- package/dist/utils/close-markdown/close-markdown.js +0 -51
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusion.dev/helix-core",
|
|
3
3
|
"description": "Helix element primitives: base classes, mixins, decorators, utilities.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.30.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@floating-ui/dom": "^1.8.0",
|
|
37
|
-
"@fusion.dev/helix-icons": "0.
|
|
37
|
+
"@fusion.dev/helix-icons": "0.30.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
41
|
-
"@fusion.dev/helix-cem": "0.
|
|
42
|
-
"@fusion.dev/helix-testing": "0.
|
|
41
|
+
"@fusion.dev/helix-cem": "0.30.0",
|
|
42
|
+
"@fusion.dev/helix-testing": "0.30.0",
|
|
43
43
|
"lit": "^3.2.1"
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://fusion.dev",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type CollectionElement, MixinCollection } from './mixin-collection.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MixinCollection } from './mixin-collection.js';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A prefix of a markdown document, made safe to render as it arrives.
|
|
3
|
-
*
|
|
4
|
-
* **A streamed answer is a prefix, and a prefix is rarely valid markdown.** The
|
|
5
|
-
* moment a model writes an opening fence, everything after it is code that has
|
|
6
|
-
* not been told it is code: a renderer handed that prefix draws paragraphs,
|
|
7
|
-
* then redraws the whole block when the closing fence lands three seconds
|
|
8
|
-
* later. The same holds for a backtick, a `**`, and a link whose target is
|
|
9
|
-
* still being typed — each renders as punctuation until its partner arrives.
|
|
10
|
-
*
|
|
11
|
-
* So this closes what is open. It does not parse markdown and does not render
|
|
12
|
-
* it: it returns a string the caller's own renderer can be handed, in which
|
|
13
|
-
* every construct that was opened is also closed.
|
|
14
|
-
*
|
|
15
|
-
* **What it does not do is remove anything a reader can already read.** The
|
|
16
|
-
* exception is a link or image whose brackets are still open, because there is
|
|
17
|
-
* no closing that: a target arrives character by character, and `[the docs](ht`
|
|
18
|
-
* has no valid completion that is not a guess at a URL. That fragment is
|
|
19
|
-
* withheld until it is whole, which is the one case where a word appears a beat
|
|
20
|
-
* later than it was received.
|
|
21
|
-
*
|
|
22
|
-
* **Inside a fence nothing else applies**, which is why closing one returns
|
|
23
|
-
* immediately. The characters in a code block are code: a stray backtick or a
|
|
24
|
-
* lone asterisk in a shell command is not an unclosed span, and treating it as
|
|
25
|
-
* one would append punctuation into somebody's code.
|
|
26
|
-
*
|
|
27
|
-
* **Underscores are left alone.** `_` opens emphasis in markdown and also sits
|
|
28
|
-
* inside `snake_case`, `__init__` and a filename, and a prefix gives no way to
|
|
29
|
-
* tell which: closing one turns an identifier into italics for as long as the
|
|
30
|
-
* rest of the word takes to arrive, which is worse than the punctuation it was
|
|
31
|
-
* meant to hide. `*` does not have that problem, being punctuation everywhere
|
|
32
|
-
* it is not emphasis.
|
|
33
|
-
*
|
|
34
|
-
* Stable across a growing prefix, which is the property that matters: calling
|
|
35
|
-
* this on each frame of a stream cannot make text move that has already
|
|
36
|
-
* settled, because everything it adds is at the end and everything it withholds
|
|
37
|
-
* is a fragment that has not been shown yet.
|
|
38
|
-
*/
|
|
39
|
-
export declare const closeMarkdown: (partial: string) => string;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const FENCE = /^ {0,3}(`{3,}|~{3,})/;
|
|
2
|
-
const OPEN_TARGET = /!?\[[^\]]*\]\([^)]*$/;
|
|
3
|
-
const OPEN_TEXT = /!?\[[^\]]*$/;
|
|
4
|
-
export const closeMarkdown = (partial) => {
|
|
5
|
-
if (partial === '') {
|
|
6
|
-
return partial;
|
|
7
|
-
}
|
|
8
|
-
let owed;
|
|
9
|
-
for (const line of partial.split('\n')) {
|
|
10
|
-
const found = FENCE.exec(line);
|
|
11
|
-
if (!found) {
|
|
12
|
-
continue;
|
|
13
|
-
}
|
|
14
|
-
const mark = found[1];
|
|
15
|
-
if (owed === undefined) {
|
|
16
|
-
owed = mark;
|
|
17
|
-
}
|
|
18
|
-
else if (mark[0] === owed[0] && mark.length >= owed.length) {
|
|
19
|
-
owed = undefined;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (owed !== undefined) {
|
|
23
|
-
return `${partial}${partial.endsWith('\n') ? '' : '\n'}${owed}`;
|
|
24
|
-
}
|
|
25
|
-
const cut = partial.lastIndexOf('\n\n');
|
|
26
|
-
const head = cut === -1 ? '' : partial.slice(0, cut + 2);
|
|
27
|
-
let tail = partial.slice(cut === -1 ? 0 : cut + 2);
|
|
28
|
-
const target = OPEN_TARGET.exec(tail);
|
|
29
|
-
if (target) {
|
|
30
|
-
tail = tail.slice(0, target.index);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
const text = OPEN_TEXT.exec(tail);
|
|
34
|
-
if (text) {
|
|
35
|
-
tail = tail.slice(0, text.index);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const ticks = (tail.match(/`/g) ?? []).length;
|
|
39
|
-
if (ticks % 2 === 1) {
|
|
40
|
-
tail += '`';
|
|
41
|
-
}
|
|
42
|
-
const strong = (tail.match(/\*\*/g) ?? []).length;
|
|
43
|
-
if (strong % 2 === 1) {
|
|
44
|
-
tail += '**';
|
|
45
|
-
}
|
|
46
|
-
const single = (tail.match(/(?<!\*)\*(?!\*)/g) ?? []).length;
|
|
47
|
-
if (single % 2 === 1) {
|
|
48
|
-
tail += '*';
|
|
49
|
-
}
|
|
50
|
-
return head + tail;
|
|
51
|
-
};
|