@burger-editor/local 4.0.0-alpha.56 → 4.0.0-alpha.58
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/client.js +228 -138
- package/dist/client.js.map +1 -1
- package/import/index.d.ts +2 -5
- package/import/index.d.ts.map +1 -1
- package/import/index.js +30 -36
- package/package.json +9 -9
- package/server/commands/search.d.ts +16 -28
- package/server/commands/search.js +79 -84
- package/server/commands/server.d.ts +1 -1
- package/server/commands/server.js +16 -17
- package/server/constants.d.ts +2 -2
- package/server/create-health-checker.d.ts +1 -1
- package/server/create-health-checker.js +14 -13
- package/server/helpers/$upload.d.ts +6 -12
- package/server/helpers/$upload.js +22 -22
- package/server/helpers/client-path-validation.d.ts +1 -1
- package/server/helpers/client-path-validation.js +7 -7
- package/server/helpers/debug.d.ts +1 -1
- package/server/helpers/edit-content.d.ts +3 -13
- package/server/helpers/edit-content.js +90 -106
- package/server/helpers/file-name.d.ts +5 -5
- package/server/helpers/file-name.js +28 -28
- package/server/helpers/front-matter.d.ts +3 -10
- package/server/helpers/front-matter.js +37 -39
- package/server/helpers/get-candidate-name.d.ts +2 -5
- package/server/helpers/get-candidate-name.js +6 -6
- package/server/helpers/get-max-file-id.d.ts +1 -1
- package/server/helpers/get-max-file-id.js +9 -9
- package/server/helpers/html-detection.d.ts +6 -15
- package/server/helpers/html-detection.js +81 -79
- package/server/helpers/no-editable-area-error.d.ts +3 -3
- package/server/helpers/no-editable-area-error.js +5 -5
- package/server/helpers/pagination.d.ts +10 -14
- package/server/helpers/pagination.js +33 -33
- package/server/helpers/scan-directory.d.ts +7 -10
- package/server/helpers/scan-directory.js +25 -27
- package/server/helpers/upload.d.ts +8 -12
- package/server/helpers/upload.js +20 -20
- package/server/index.d.ts +1 -1
- package/server/index.js +11 -10
- package/server/model/default-config.d.ts +6 -6
- package/server/model/default-config.js +5 -5
- package/server/model/file-list-manager.d.ts +11 -20
- package/server/model/file-list-manager.js +150 -156
- package/server/model/file-tree.d.ts +7 -10
- package/server/model/file-tree.js +25 -26
- package/server/model/get-user-config.d.ts +1 -1
- package/server/model/get-user-config.js +86 -88
- package/server/route.d.ts +327 -377
- package/server/route.js +225 -305
- package/server/search/output-formatter.d.ts +3 -3
- package/server/search/output-formatter.js +10 -10
- package/server/types.d.ts +54 -57
- package/server/view/app.d.ts +8 -15
- package/server/view/app.js +3 -40
- package/server/view/layout.d.ts +3 -6
- package/server/view/layout.js +2 -23
- package/server/view/nav-tree.d.ts +4 -6
- package/server/view/nav-tree.js +2 -19
- package/server/view/nav.d.ts +4 -6
- package/server/view/nav.js +3 -46
package/dist/client.js
CHANGED
|
@@ -1296,7 +1296,7 @@ var style$b = "/* No Styling */\n";
|
|
|
1296
1296
|
var template$b = "<a href=\"\" data-kind=\"primary\" data-before-icon=\"none\" data-after-icon=\"none\" data-bge=\"link:href, target:target, kind:data-kind, before-icon:data-before-icon, after-icon:data-after-icon\">\n\t<div>\n\t\t<span data-bge=\"text\">ボタン</span>\n\t\t<span data-bge=\"subtext\">サブテキスト</span>\n\t</div>\n</a>\n";
|
|
1297
1297
|
|
|
1298
1298
|
var button = createItem$1({
|
|
1299
|
-
version: "4.0.0-alpha.
|
|
1299
|
+
version: "4.0.0-alpha.57",
|
|
1300
1300
|
name: "button",
|
|
1301
1301
|
template: template$b,
|
|
1302
1302
|
style: style$b,
|
|
@@ -1352,7 +1352,7 @@ var style$a = "/* No Styling */\n";
|
|
|
1352
1352
|
var template$a = "<details data-bge=\"open:open\">\n\t<summary data-bge=\"summary\">折りたたみコンテンツ</summary>\n\t<div data-bge=\"content\"><p>内容を入力してください</p></div>\n</details>\n";
|
|
1353
1353
|
|
|
1354
1354
|
var details = createItem$1({
|
|
1355
|
-
version: "4.0.0-alpha.
|
|
1355
|
+
version: "4.0.0-alpha.57",
|
|
1356
1356
|
name: "details",
|
|
1357
1357
|
template: template$a,
|
|
1358
1358
|
style: style$a,
|
|
@@ -1366,7 +1366,7 @@ var style$9 = "[data-bgi='download-file'] {\n\t[data-bge*='size'] {\n\t\t&::befo
|
|
|
1366
1366
|
var template$9 = "<a href=\"./files/bgeditor/bg-sample.pdf\" target=\"_blank\" data-bge=\"path:href, download:download\">\n\t<div>\n\t\t<span data-bge=\"name\">サンプルダウンロードファイル</span>\n\t\t<span data-bge=\"formated-size, size:data-size\" data-size=\"138158\">134.92kB</span>\n\t</div>\n</a>\n";
|
|
1367
1367
|
|
|
1368
1368
|
var downloadFile = createItem$1({
|
|
1369
|
-
version: "4.0.0-alpha.
|
|
1369
|
+
version: "4.0.0-alpha.57",
|
|
1370
1370
|
name: "download-file",
|
|
1371
1371
|
template: template$9,
|
|
1372
1372
|
style: style$9,
|
|
@@ -1405,7 +1405,7 @@ var style$8 = "[data-bgi='google-maps'] {\n\tdiv {\n\t\tinline-size: 100%;\n\t\t
|
|
|
1405
1405
|
var template$8 = "<div data-lat=\"35.681382\" data-lng=\"139.766084\" data-zoom=\"16\" data-bge=\"lat:data-lat, lng:data-lng, zoom:data-zoom\">\n\t<img data-bge=\"img:src\" src=\"https://maps.google.com/maps/api/staticmap?center=35.681382,139.766084&zoom=16&size=640x400&markers=color:red|color:red|35.681382,139.766084&scale=2&key=%googleMapsApiKey%\" width=\"8\" height=\"5\" alt=\"Google Maps\" />\n</div>\n<a href=\"https://maps.apple.com/?q=35.681382,139.766084\" data-bge=\"url:href\" target=\"_blank\"><span>アプリで開く</span></a>\n";
|
|
1406
1406
|
|
|
1407
1407
|
var googleMaps = createItem$1({
|
|
1408
|
-
version: "4.0.0-alpha.
|
|
1408
|
+
version: "4.0.0-alpha.57",
|
|
1409
1409
|
name: "google-maps",
|
|
1410
1410
|
template: template$8,
|
|
1411
1411
|
style: style$8,
|
|
@@ -1540,18 +1540,18 @@ var style$7 = "[data-bgi='hr'] {\n\t--inline-size: 100%;\n\t--border-color: #000
|
|
|
1540
1540
|
var template$7 = "<div data-bgi-hr-kind=\"primary\" data-bge=\"kind:data-bgi-hr-kind\">\n\t<hr />\n</div>\n";
|
|
1541
1541
|
|
|
1542
1542
|
var hr = createItem$1({
|
|
1543
|
-
version: "4.0.0-alpha.
|
|
1543
|
+
version: "4.0.0-alpha.57",
|
|
1544
1544
|
name: "hr",
|
|
1545
1545
|
template: template$7,
|
|
1546
1546
|
style: style$7,
|
|
1547
1547
|
editor: editor$7
|
|
1548
1548
|
});
|
|
1549
1549
|
|
|
1550
|
-
var editor$6 = "<div data-bge-dialog=\"2col\">\n\t<div data-bge-dialog-ui=\"sticky\">\n\t\t<div>\n\t\t\t<div data-bge-editor-ui=\"tabs\" data-bge-editor-ui-for=\"bgi-image__tabs-content\"></div>\n\n\t\t\t<div id=\"bgi-image__tabs-content\" role=\"tabpanel\" aria-label=\"画像\">\n\t\t\t\t<div data-bge-editor-ui=\"preview\"></div>\n\t\t\t\t<input type=\"hidden\" name=\"bge-path[]\" />\n\t\t\t\t<input type=\"hidden\" name=\"bge-alt[]\" />\n\t\t\t\t<input type=\"hidden\" name=\"bge-width[]\" />\n\t\t\t\t<input type=\"hidden\" name=\"bge-height[]\" />\n\t\t\t\t<input type=\"hidden\" name=\"bge-media[]\" />\n\n\t\t\t\t<input type=\"hidden\" name=\"bge-file-size\" />\n\t\t\t\t<div>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<span>メディアクエリー</span>\n\t\t\t\t\t\t<input type=\"text\" name=\"bge-media-input\" />\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div>\n\t\t\t<fieldset id=\"bge-image-size-fieldset\">\n\t\t\t\t<legend>画像のサイズ</legend>\n\t\t\t\t<div role=\"radiogroup\" aria-labelledby=\"bgi-image__radio-group1\">\n\t\t\t\t\t<div id=\"bgi-image__radio-group1\">基準</div>\n\t\t\t\t\t<label><input type=\"radio\" name=\"bge-scale-type\" value=\"container\" /><span>基準</span></label>\n\t\t\t\t\t<label><input type=\"radio\" name=\"bge-scale-type\" value=\"original\" checked />画像基準</label>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<label for=\"bgi-image__range-number\">幅</label>\n\t\t\t\t\t\t<input type=\"number\" id=\"bgi-image__range-number\" name=\"bge-css-width-number\" min=\"1\" step=\"1\" value=\"100\" />\n\t\t\t\t\t\t<output name=\"bge-css-width-unit\">px</output>\n\t\t\t\t\t</span>\n\t\t\t\t\t<input aria-label=\"幅\" type=\"range\" name=\"bge-scale\" min=\"1\" max=\"100\" step=\"1\" value=\"100\" />\n\t\t\t\t</div>\n\t\t\t\t<div role=\"radiogroup\" aria-labelledby=\"bgi-image__radio-group2\">\n\t\t\t\t\t<div id=\"bgi-image__radio-group2\">縦横比</div>\n\t\t\t\t\t<label><input type=\"radio\" name=\"bge-aspect-ratio\" value=\"
|
|
1550
|
+
var editor$6 = "<div data-bge-dialog=\"2col\">\n\t<div data-bge-dialog-ui=\"sticky\">\n\t\t<div>\n\t\t\t<div data-bge-editor-ui=\"tabs\" data-bge-editor-ui-for=\"bgi-image__tabs-content\"></div>\n\n\t\t\t<div id=\"bgi-image__tabs-content\" role=\"tabpanel\" aria-label=\"画像\">\n\t\t\t\t<div data-bge-editor-ui=\"preview\"></div>\n\t\t\t\t<input type=\"hidden\" name=\"bge-path[]\" />\n\t\t\t\t<input type=\"hidden\" name=\"bge-alt[]\" />\n\t\t\t\t<input type=\"hidden\" name=\"bge-width[]\" />\n\t\t\t\t<input type=\"hidden\" name=\"bge-height[]\" />\n\t\t\t\t<input type=\"hidden\" name=\"bge-media[]\" />\n\n\t\t\t\t<input type=\"hidden\" name=\"bge-file-size\" />\n\t\t\t\t<div>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<span>メディアクエリー</span>\n\t\t\t\t\t\t<input type=\"text\" name=\"bge-media-input\" />\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div>\n\t\t\t<fieldset id=\"bge-image-size-fieldset\">\n\t\t\t\t<legend>画像のサイズ</legend>\n\t\t\t\t<div role=\"radiogroup\" aria-labelledby=\"bgi-image__radio-group1\">\n\t\t\t\t\t<div id=\"bgi-image__radio-group1\">基準</div>\n\t\t\t\t\t<label><input type=\"radio\" name=\"bge-scale-type\" value=\"container\" /><span>基準</span></label>\n\t\t\t\t\t<label><input type=\"radio\" name=\"bge-scale-type\" value=\"original\" checked />画像基準</label>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<label for=\"bgi-image__range-number\">幅</label>\n\t\t\t\t\t\t<input type=\"number\" id=\"bgi-image__range-number\" name=\"bge-css-width-number\" min=\"1\" step=\"1\" value=\"100\" />\n\t\t\t\t\t\t<output name=\"bge-css-width-unit\">px</output>\n\t\t\t\t\t</span>\n\t\t\t\t\t<input aria-label=\"幅\" type=\"range\" name=\"bge-scale\" min=\"1\" max=\"100\" step=\"1\" value=\"100\" />\n\t\t\t\t</div>\n\t\t\t\t<div role=\"radiogroup\" aria-labelledby=\"bgi-image__radio-group2\">\n\t\t\t\t\t<div id=\"bgi-image__radio-group2\">縦横比</div>\n\t\t\t\t\t<label><input type=\"radio\" name=\"bge-aspect-ratio\" value=\"revert\" checked />オリジナル</label>\n\t\t\t\t\t<label><input type=\"radio\" name=\"bge-aspect-ratio\" value=\"1/1\" />1 : 1</label>\n\t\t\t\t\t<label><input type=\"radio\" name=\"bge-aspect-ratio\" value=\"4/3\" />4 : 3</label>\n\t\t\t\t\t<label><input type=\"radio\" name=\"bge-aspect-ratio\" value=\"16/9\" />16 : 9</label>\n\t\t\t\t</div>\n\t\t\t\t<input type=\"hidden\" name=\"bge-css-width\" />\n\t\t\t</fieldset>\n\t\t\t<label>\n\t\t\t\t<span>画像の代替テキスト(alt)</span>\n\t\t\t\t<input type=\"text\" name=\"bge-alt-editable\" />\n\t\t\t</label>\n\t\t\t<label>\n\t\t\t\t<span>キャプション</span>\n\t\t\t\t<input type=\"text\" name=\"bge-caption\" />\n\t\t\t</label>\n\t\t\t<fieldset>\n\t\t\t\t<legend>リンク</legend>\n\t\t\t\t<label><input type=\"checkbox\" name=\"bge-popup\" />ポップアップで画像を開く</label>\n\t\t\t\t<label>\n\t\t\t\t\t<span>リンク先URL</span>\n\t\t\t\t\t<input type=\"url\" name=\"bge-href\" />\n\t\t\t\t</label>\n\t\t\t\t<label><input type=\"checkbox\" name=\"bge-target-blank\" />別タブで開く</label>\n\t\t\t</fieldset>\n\t\t\t<label><input type=\"checkbox\" name=\"bge-lazy\" checked aria-describedby=\"bge-lazy-desc\" />遅延読み込み</label>\n\t\t\t<small id=\"bge-lazy-desc\">画像がブラウザの表示エリアに現れるまでファイルを読み込みません。</small>\n\t\t</div>\n\t</div>\n\t<div>\n\t\t<div data-bge-editor-ui=\"imageUploader\"></div>\n\t\t<div data-bge-editor-ui=\"imageList\"></div>\n\t</div>\n</div>\n";
|
|
1551
1551
|
|
|
1552
|
-
var style$6 = "[data-bgi='image'] {\n\tfigure {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tinline-size: var(--css-width, 100%);\n\t\tmax-inline-size: 100cqi;\n\t\tpadding: 0;\n\t\tmargin-block: 0;\n\t\tmargin-inline: auto;\n\n\t\t> :is(div, a, button) {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0;\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t}\n\t}\n\n\timg {\n\t\tdisplay: block;\n\t\tinline-size: var(--css-width, auto);\n\t\tmax-inline-size: 100%;\n\t\tblock-size: auto;\n\t\taspect-ratio: var(--aspect-ratio,
|
|
1552
|
+
var style$6 = "[data-bgi='image'] {\n\tfigure {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tinline-size: var(--css-width, 100%);\n\t\tmax-inline-size: 100cqi;\n\t\tpadding: 0;\n\t\tmargin-block: 0;\n\t\tmargin-inline: auto;\n\n\t\t> :is(div, a, button) {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0;\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t}\n\t}\n\n\timg {\n\t\tdisplay: block;\n\t\tinline-size: var(--css-width, auto);\n\t\tmax-inline-size: 100%;\n\t\tblock-size: auto;\n\t\taspect-ratio: var(--aspect-ratio, revert);\n\t\tobject-fit: var(--object-fit, unset);\n\t}\n\n\tfigcaption {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\tinline-size: 100%;\n\n\t\t&:empty {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n";
|
|
1553
1553
|
|
|
1554
|
-
var template$6 = "<div data-bge=\":style, :scale, :scale-type, :aspect-ratio\" data-bge-scale=\"100\" data-bge-scale-type=\"container\" data-bge-aspect-ratio=\"
|
|
1554
|
+
var template$6 = "<div data-bge=\":style, :scale, :scale-type, :aspect-ratio\" data-bge-scale=\"100\" data-bge-scale-type=\"container\" data-bge-aspect-ratio=\"revert\" style=\"--css-width: 100cqi; --object-fit: cover; --aspect-ratio: revert\">\n\t<figure>\n\t\t<div data-bge=\":node, :href, :target, :command\">\n\t\t\t<picture data-bge-list>\n\t\t\t\t<img src=\"%sampleImagePath%\" alt=\"サンプル画像\" data-bge=\"path:src, :alt, :width, :height, :loading, :media\" width=\"400\" height=\"300\" loading=\"lazy\" />\n\t\t\t</picture>\n\t\t</div>\n\t\t<figcaption data-bge=\"caption\"></figcaption>\n\t</figure>\n</div>\n";
|
|
1555
1555
|
|
|
1556
1556
|
function createWidthState() {
|
|
1557
1557
|
const MIN_NUMBER = 1;
|
|
@@ -1630,7 +1630,7 @@ function createWidthState() {
|
|
|
1630
1630
|
|
|
1631
1631
|
const ORIGIN = "__org";
|
|
1632
1632
|
var image = createItem$1({
|
|
1633
|
-
version: "4.0.0-alpha.
|
|
1633
|
+
version: "4.0.0-alpha.57",
|
|
1634
1634
|
name: "image",
|
|
1635
1635
|
template: template$6,
|
|
1636
1636
|
style: style$6,
|
|
@@ -1828,7 +1828,7 @@ var style$5 = "[data-bgi='import'] {\n\tbge-import {\n\t\t&::before {\n\t\t\tfon
|
|
|
1828
1828
|
var template$5 = "<bge-import data-bge=\":src\" src=\"\"></bge-import>\n";
|
|
1829
1829
|
|
|
1830
1830
|
var importItem = createItem$1({
|
|
1831
|
-
version: "4.0.0-alpha.
|
|
1831
|
+
version: "4.0.0-alpha.57",
|
|
1832
1832
|
name: "import",
|
|
1833
1833
|
template: template$5,
|
|
1834
1834
|
style: style$5,
|
|
@@ -1842,7 +1842,7 @@ var style$4 = "/* No Styling */\n";
|
|
|
1842
1842
|
var template$4 = "<div data-bge=\":scrollable\" data-bge-scrollable=\"false\">\n\t<table>\n\t\t<caption data-bge=\"caption\">\n\t\t\tキャプションを入力してください\n\t\t</caption>\n\t\t<tbody data-bge-list>\n\t\t\t<tr>\n\t\t\t\t<th data-bge=\"th\">表組の見出し</th>\n\t\t\t\t<td data-bge=\"td\">表組の内容を入力してください</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n";
|
|
1843
1843
|
|
|
1844
1844
|
var table = createItem$1({
|
|
1845
|
-
version: "4.0.0-alpha.
|
|
1845
|
+
version: "4.0.0-alpha.57",
|
|
1846
1846
|
name: "table",
|
|
1847
1847
|
template: template$4,
|
|
1848
1848
|
style: style$4,
|
|
@@ -1870,7 +1870,7 @@ var style$3 = "/* No Styling */\n";
|
|
|
1870
1870
|
var template$3 = "<h2 data-bge=\"title-h2\">見出しを入力してください</h2>\n";
|
|
1871
1871
|
|
|
1872
1872
|
var titleH2 = createItem$1({
|
|
1873
|
-
version: "4.0.0-alpha.
|
|
1873
|
+
version: "4.0.0-alpha.57",
|
|
1874
1874
|
name: "title-h2",
|
|
1875
1875
|
template: template$3,
|
|
1876
1876
|
style: style$3,
|
|
@@ -1884,7 +1884,7 @@ var style$2 = "/* No Styling */\n";
|
|
|
1884
1884
|
var template$2 = "<h3 data-bge=\"title-h3\">見出しを入力してください</h3>\n";
|
|
1885
1885
|
|
|
1886
1886
|
var titleH3 = createItem$1({
|
|
1887
|
-
version: "4.0.0-alpha.
|
|
1887
|
+
version: "4.0.0-alpha.57",
|
|
1888
1888
|
name: "title-h3",
|
|
1889
1889
|
template: template$2,
|
|
1890
1890
|
style: style$2,
|
|
@@ -1898,7 +1898,7 @@ var style$1 = "/* No Styling */\n";
|
|
|
1898
1898
|
var template$1 = "<div data-bge=\"wysiwyg\"><p>本文を入力してください</p></div>\n";
|
|
1899
1899
|
|
|
1900
1900
|
var wysiwyg = createItem$1({
|
|
1901
|
-
version: "4.0.0-alpha.
|
|
1901
|
+
version: "4.0.0-alpha.57",
|
|
1902
1902
|
name: "wysiwyg",
|
|
1903
1903
|
template: template$1,
|
|
1904
1904
|
style: style$1,
|
|
@@ -1913,7 +1913,7 @@ var template = "<div data-id=\"3KtWfp0UopM\" data-title=\"YouTube動画\" data-w
|
|
|
1913
1913
|
|
|
1914
1914
|
const FALLBACK_TITLE = "YouTube\u52D5\u753B";
|
|
1915
1915
|
var youtube = createItem$1({
|
|
1916
|
-
version: "4.0.0-alpha.
|
|
1916
|
+
version: "4.0.0-alpha.57",
|
|
1917
1917
|
name: "youtube",
|
|
1918
1918
|
template,
|
|
1919
1919
|
style: style$c,
|
|
@@ -4220,6 +4220,10 @@ function set$1(el, prefix, name, datum, xssSanitize = true) {
|
|
|
4220
4220
|
el.removeAttribute(name);
|
|
4221
4221
|
return;
|
|
4222
4222
|
}
|
|
4223
|
+
if (el.localName.includes("-")) {
|
|
4224
|
+
el.setAttribute(name, `${datum}`);
|
|
4225
|
+
return;
|
|
4226
|
+
}
|
|
4223
4227
|
if (!name.startsWith("data-") && !propInElement(el, name)) {
|
|
4224
4228
|
const dataAttr = `data-${prefix}-${kebabCase(name)}`;
|
|
4225
4229
|
if (el.hasAttribute(dataAttr)) {
|
|
@@ -11960,6 +11964,27 @@ class Transform {
|
|
|
11960
11964
|
return this.steps.length > 0;
|
|
11961
11965
|
}
|
|
11962
11966
|
/**
|
|
11967
|
+
Return a single range, in post-transform document positions,
|
|
11968
|
+
that covers all content changed by this transform. Returns null
|
|
11969
|
+
if no replacements are made. Note that this will ignore changes
|
|
11970
|
+
that add/remove marks without replacing the underlying content.
|
|
11971
|
+
*/
|
|
11972
|
+
changedRange() {
|
|
11973
|
+
let from2 = 1e9, to = -1e9;
|
|
11974
|
+
for (let i = 0; i < this.mapping.maps.length; i++) {
|
|
11975
|
+
let map2 = this.mapping.maps[i];
|
|
11976
|
+
if (i) {
|
|
11977
|
+
from2 = map2.map(from2, 1);
|
|
11978
|
+
to = map2.map(to, -1);
|
|
11979
|
+
}
|
|
11980
|
+
map2.forEach((_f, _t, fromB, toB) => {
|
|
11981
|
+
from2 = Math.min(from2, fromB);
|
|
11982
|
+
to = Math.max(to, toB);
|
|
11983
|
+
});
|
|
11984
|
+
}
|
|
11985
|
+
return from2 == 1e9 ? null : { from: from2, to };
|
|
11986
|
+
}
|
|
11987
|
+
/**
|
|
11963
11988
|
@internal
|
|
11964
11989
|
*/
|
|
11965
11990
|
addStep(step, doc2) {
|
|
@@ -19576,8 +19601,12 @@ var focus = (position = null, options = {}) => ({ editor, view, tr: tr2, dispatc
|
|
|
19576
19601
|
}
|
|
19577
19602
|
});
|
|
19578
19603
|
};
|
|
19579
|
-
|
|
19580
|
-
|
|
19604
|
+
try {
|
|
19605
|
+
if (view.hasFocus() && position === null || position === false) {
|
|
19606
|
+
return true;
|
|
19607
|
+
}
|
|
19608
|
+
} catch {
|
|
19609
|
+
return false;
|
|
19581
19610
|
}
|
|
19582
19611
|
if (dispatch && position === null && !isTextSelection(editor.state.selection)) {
|
|
19583
19612
|
delayedFocus();
|
|
@@ -22864,19 +22893,20 @@ var NodePos = class _NodePos {
|
|
|
22864
22893
|
this.node.content.forEach((node, offset) => {
|
|
22865
22894
|
const isBlock = node.isBlock && !node.isTextblock;
|
|
22866
22895
|
const isNonTextAtom = node.isAtom && !node.isText;
|
|
22896
|
+
const isInline2 = node.isInline;
|
|
22867
22897
|
const targetPos = this.pos + offset + (isNonTextAtom ? 0 : 1);
|
|
22868
22898
|
if (targetPos < 0 || targetPos > this.resolvedPos.doc.nodeSize - 2) {
|
|
22869
22899
|
return;
|
|
22870
22900
|
}
|
|
22871
22901
|
const $pos = this.resolvedPos.doc.resolve(targetPos);
|
|
22872
|
-
if (!isBlock && $pos.depth <= this.depth) {
|
|
22902
|
+
if (!isBlock && !isInline2 && $pos.depth <= this.depth) {
|
|
22873
22903
|
return;
|
|
22874
22904
|
}
|
|
22875
|
-
const childNodePos = new _NodePos($pos, this.editor, isBlock, isBlock ? node : null);
|
|
22905
|
+
const childNodePos = new _NodePos($pos, this.editor, isBlock, isBlock || isInline2 ? node : null);
|
|
22876
22906
|
if (isBlock) {
|
|
22877
22907
|
childNodePos.actualDepth = this.depth + 1;
|
|
22878
22908
|
}
|
|
22879
|
-
children.push(
|
|
22909
|
+
children.push(childNodePos);
|
|
22880
22910
|
});
|
|
22881
22911
|
return children;
|
|
22882
22912
|
}
|
|
@@ -23839,7 +23869,8 @@ var ResizableNodeView = class {
|
|
|
23839
23869
|
return this.container;
|
|
23840
23870
|
}
|
|
23841
23871
|
get contentDOM() {
|
|
23842
|
-
|
|
23872
|
+
var _a2;
|
|
23873
|
+
return (_a2 = this.contentElement) != null ? _a2 : null;
|
|
23843
23874
|
}
|
|
23844
23875
|
handleEditorUpdate() {
|
|
23845
23876
|
const isEditable = this.editor.isEditable;
|
|
@@ -27067,6 +27098,9 @@ var Link = Mark2.create({
|
|
|
27067
27098
|
},
|
|
27068
27099
|
class: {
|
|
27069
27100
|
default: this.options.HTMLAttributes.class
|
|
27101
|
+
},
|
|
27102
|
+
title: {
|
|
27103
|
+
default: null
|
|
27070
27104
|
}
|
|
27071
27105
|
};
|
|
27072
27106
|
},
|
|
@@ -27106,10 +27140,11 @@ var Link = Mark2.create({
|
|
|
27106
27140
|
});
|
|
27107
27141
|
},
|
|
27108
27142
|
renderMarkdown: (node, h2) => {
|
|
27109
|
-
var _a2;
|
|
27110
|
-
const href = ((_a2 = node.attrs) == null ? void 0 : _a2.href)
|
|
27143
|
+
var _a2, _b, _c, _d;
|
|
27144
|
+
const href = (_b = (_a2 = node.attrs) == null ? void 0 : _a2.href) != null ? _b : "";
|
|
27145
|
+
const title = (_d = (_c = node.attrs) == null ? void 0 : _c.title) != null ? _d : "";
|
|
27111
27146
|
const text2 = h2.renderChildren(node);
|
|
27112
|
-
return `[${text2}](${href})`;
|
|
27147
|
+
return title ? `[${text2}](${href} "${title}")` : `[${text2}](${href})`;
|
|
27113
27148
|
},
|
|
27114
27149
|
addCommands() {
|
|
27115
27150
|
return {
|
|
@@ -27370,11 +27405,13 @@ var ListItem = Node3.create({
|
|
|
27370
27405
|
node,
|
|
27371
27406
|
h2,
|
|
27372
27407
|
(context) => {
|
|
27408
|
+
var _a2, _b;
|
|
27373
27409
|
if (context.parentType === "bulletList") {
|
|
27374
27410
|
return "- ";
|
|
27375
27411
|
}
|
|
27376
27412
|
if (context.parentType === "orderedList") {
|
|
27377
|
-
|
|
27413
|
+
const start = ((_b = (_a2 = context.meta) == null ? void 0 : _a2.parentAttrs) == null ? void 0 : _b.start) || 1;
|
|
27414
|
+
return `${start + context.index}. `;
|
|
27378
27415
|
}
|
|
27379
27416
|
return "- ";
|
|
27380
27417
|
},
|
|
@@ -28240,6 +28277,8 @@ Extension.create({
|
|
|
28240
28277
|
return extensions;
|
|
28241
28278
|
}
|
|
28242
28279
|
});
|
|
28280
|
+
var EMPTY_PARAGRAPH_MARKDOWN = " ";
|
|
28281
|
+
var NBSP_CHAR = " ";
|
|
28243
28282
|
var Paragraph = Node3.create({
|
|
28244
28283
|
name: "paragraph",
|
|
28245
28284
|
priority: 1e3,
|
|
@@ -28261,18 +28300,21 @@ var Paragraph = Node3.create({
|
|
|
28261
28300
|
if (tokens.length === 1 && tokens[0].type === "image") {
|
|
28262
28301
|
return helpers.parseChildren([tokens[0]]);
|
|
28263
28302
|
}
|
|
28264
|
-
|
|
28265
|
-
|
|
28266
|
-
void 0,
|
|
28267
|
-
|
|
28268
|
-
|
|
28269
|
-
);
|
|
28303
|
+
const content = helpers.parseInline(tokens);
|
|
28304
|
+
if (content.length === 1 && content[0].type === "text" && (content[0].text === EMPTY_PARAGRAPH_MARKDOWN || content[0].text === NBSP_CHAR)) {
|
|
28305
|
+
return helpers.createNode("paragraph", void 0, []);
|
|
28306
|
+
}
|
|
28307
|
+
return helpers.createNode("paragraph", void 0, content);
|
|
28270
28308
|
},
|
|
28271
28309
|
renderMarkdown: (node, h2) => {
|
|
28272
|
-
if (!node
|
|
28310
|
+
if (!node) {
|
|
28273
28311
|
return "";
|
|
28274
28312
|
}
|
|
28275
|
-
|
|
28313
|
+
const content = Array.isArray(node.content) ? node.content : [];
|
|
28314
|
+
if (content.length === 0) {
|
|
28315
|
+
return EMPTY_PARAGRAPH_MARKDOWN;
|
|
28316
|
+
}
|
|
28317
|
+
return h2.renderChildren(content);
|
|
28276
28318
|
},
|
|
28277
28319
|
addCommands() {
|
|
28278
28320
|
return {
|
|
@@ -29496,12 +29538,17 @@ var Gapcursor = Extension.create({
|
|
|
29496
29538
|
};
|
|
29497
29539
|
}
|
|
29498
29540
|
});
|
|
29541
|
+
var DEFAULT_DATA_ATTRIBUTE = "placeholder";
|
|
29542
|
+
function preparePlaceholderAttribute(attr) {
|
|
29543
|
+
return attr.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
29544
|
+
}
|
|
29499
29545
|
Extension.create({
|
|
29500
29546
|
name: "placeholder",
|
|
29501
29547
|
addOptions() {
|
|
29502
29548
|
return {
|
|
29503
29549
|
emptyEditorClass: "is-editor-empty",
|
|
29504
29550
|
emptyNodeClass: "is-empty",
|
|
29551
|
+
dataAttribute: DEFAULT_DATA_ATTRIBUTE,
|
|
29505
29552
|
placeholder: "Write something …",
|
|
29506
29553
|
showOnlyWhenEditable: true,
|
|
29507
29554
|
showOnlyCurrent: true,
|
|
@@ -29509,6 +29556,7 @@ Extension.create({
|
|
|
29509
29556
|
};
|
|
29510
29557
|
},
|
|
29511
29558
|
addProseMirrorPlugins() {
|
|
29559
|
+
const dataAttribute = this.options.dataAttribute ? `data-${preparePlaceholderAttribute(this.options.dataAttribute)}` : `data-${DEFAULT_DATA_ATTRIBUTE}`;
|
|
29512
29560
|
return [
|
|
29513
29561
|
new Plugin({
|
|
29514
29562
|
key: new PluginKey("placeholder"),
|
|
@@ -29531,7 +29579,7 @@ Extension.create({
|
|
|
29531
29579
|
}
|
|
29532
29580
|
const decoration = Decoration.node(pos, pos + node.nodeSize, {
|
|
29533
29581
|
class: classes.join(" "),
|
|
29534
|
-
|
|
29582
|
+
[dataAttribute]: typeof this.options.placeholder === "function" ? this.options.placeholder({
|
|
29535
29583
|
editor: this.editor,
|
|
29536
29584
|
node,
|
|
29537
29585
|
pos,
|
|
@@ -33826,6 +33874,7 @@ const ATTACHMENT_KEY = "@attach";
|
|
|
33826
33874
|
const DEV = false;
|
|
33827
33875
|
var is_array = Array.isArray;
|
|
33828
33876
|
var index_of = Array.prototype.indexOf;
|
|
33877
|
+
var includes = Array.prototype.includes;
|
|
33829
33878
|
var array_from = Array.from;
|
|
33830
33879
|
var define_property = Object.defineProperty;
|
|
33831
33880
|
var get_descriptor = Object.getOwnPropertyDescriptor;
|
|
@@ -34153,35 +34202,70 @@ class Batch {
|
|
|
34153
34202
|
*/
|
|
34154
34203
|
#maybe_dirty_effects = /* @__PURE__ */ new Set();
|
|
34155
34204
|
/**
|
|
34156
|
-
* A
|
|
34157
|
-
* is committed — we skip over these during `process
|
|
34158
|
-
*
|
|
34205
|
+
* A map of branches that still exist, but will be destroyed when this batch
|
|
34206
|
+
* is committed — we skip over these during `process`.
|
|
34207
|
+
* The value contains child effects that were dirty/maybe_dirty before being reset,
|
|
34208
|
+
* so they can be rescheduled if the branch survives.
|
|
34209
|
+
* @type {Map<Effect, { d: Effect[], m: Effect[] }>}
|
|
34159
34210
|
*/
|
|
34160
|
-
|
|
34211
|
+
#skipped_branches = /* @__PURE__ */ new Map();
|
|
34161
34212
|
is_fork = false;
|
|
34213
|
+
#decrement_queued = false;
|
|
34162
34214
|
is_deferred() {
|
|
34163
34215
|
return this.is_fork || this.#blocking_pending > 0;
|
|
34164
34216
|
}
|
|
34217
|
+
/**
|
|
34218
|
+
* Add an effect to the #skipped_branches map and reset its children
|
|
34219
|
+
* @param {Effect} effect
|
|
34220
|
+
*/
|
|
34221
|
+
skip_effect(effect2) {
|
|
34222
|
+
if (!this.#skipped_branches.has(effect2)) {
|
|
34223
|
+
this.#skipped_branches.set(effect2, { d: [], m: [] });
|
|
34224
|
+
}
|
|
34225
|
+
}
|
|
34226
|
+
/**
|
|
34227
|
+
* Remove an effect from the #skipped_branches map and reschedule
|
|
34228
|
+
* any tracked dirty/maybe_dirty child effects
|
|
34229
|
+
* @param {Effect} effect
|
|
34230
|
+
*/
|
|
34231
|
+
unskip_effect(effect2) {
|
|
34232
|
+
var tracked = this.#skipped_branches.get(effect2);
|
|
34233
|
+
if (tracked) {
|
|
34234
|
+
this.#skipped_branches.delete(effect2);
|
|
34235
|
+
for (var e of tracked.d) {
|
|
34236
|
+
set_signal_status(e, DIRTY);
|
|
34237
|
+
schedule_effect(e);
|
|
34238
|
+
}
|
|
34239
|
+
for (e of tracked.m) {
|
|
34240
|
+
set_signal_status(e, MAYBE_DIRTY);
|
|
34241
|
+
schedule_effect(e);
|
|
34242
|
+
}
|
|
34243
|
+
}
|
|
34244
|
+
}
|
|
34165
34245
|
/**
|
|
34166
34246
|
*
|
|
34167
34247
|
* @param {Effect[]} root_effects
|
|
34168
34248
|
*/
|
|
34169
34249
|
process(root_effects) {
|
|
34170
34250
|
queued_root_effects = [];
|
|
34171
|
-
previous_batch = null;
|
|
34172
34251
|
this.apply();
|
|
34173
34252
|
var effects = [];
|
|
34174
34253
|
var render_effects = [];
|
|
34175
34254
|
for (const root2 of root_effects) {
|
|
34176
34255
|
this.#traverse_effect_tree(root2, effects, render_effects);
|
|
34177
34256
|
}
|
|
34178
|
-
if (!this.is_fork) {
|
|
34179
|
-
this.#resolve();
|
|
34180
|
-
}
|
|
34181
34257
|
if (this.is_deferred()) {
|
|
34182
34258
|
this.#defer_effects(render_effects);
|
|
34183
34259
|
this.#defer_effects(effects);
|
|
34260
|
+
for (const [e, t] of this.#skipped_branches) {
|
|
34261
|
+
reset_branch(e, t);
|
|
34262
|
+
}
|
|
34184
34263
|
} else {
|
|
34264
|
+
for (const fn of this.#commit_callbacks) fn();
|
|
34265
|
+
this.#commit_callbacks.clear();
|
|
34266
|
+
if (this.#pending === 0) {
|
|
34267
|
+
this.#commit();
|
|
34268
|
+
}
|
|
34185
34269
|
previous_batch = this;
|
|
34186
34270
|
current_batch = null;
|
|
34187
34271
|
flush_queued_effects(render_effects);
|
|
@@ -34206,7 +34290,7 @@ class Batch {
|
|
|
34206
34290
|
var flags2 = effect2.f;
|
|
34207
34291
|
var is_branch = (flags2 & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;
|
|
34208
34292
|
var is_skippable_branch = is_branch && (flags2 & CLEAN) !== 0;
|
|
34209
|
-
var skip = is_skippable_branch || (flags2 & INERT) !== 0 || this.
|
|
34293
|
+
var skip = is_skippable_branch || (flags2 & INERT) !== 0 || this.#skipped_branches.has(effect2);
|
|
34210
34294
|
if (!skip && effect2.fn !== null) {
|
|
34211
34295
|
if (is_branch) {
|
|
34212
34296
|
effect2.f ^= CLEAN;
|
|
@@ -34215,7 +34299,7 @@ class Batch {
|
|
|
34215
34299
|
} else if ((flags2 & EFFECT) !== 0) {
|
|
34216
34300
|
effects.push(effect2);
|
|
34217
34301
|
} else if (is_dirty(effect2)) {
|
|
34218
|
-
if ((flags2 & BLOCK_EFFECT) !== 0) this.#
|
|
34302
|
+
if ((flags2 & BLOCK_EFFECT) !== 0) this.#maybe_dirty_effects.add(effect2);
|
|
34219
34303
|
update_effect(effect2);
|
|
34220
34304
|
}
|
|
34221
34305
|
var child2 = effect2.first;
|
|
@@ -34283,15 +34367,6 @@ class Batch {
|
|
|
34283
34367
|
for (const fn of this.#discard_callbacks) fn(this);
|
|
34284
34368
|
this.#discard_callbacks.clear();
|
|
34285
34369
|
}
|
|
34286
|
-
#resolve() {
|
|
34287
|
-
if (this.#blocking_pending === 0) {
|
|
34288
|
-
for (const fn of this.#commit_callbacks) fn();
|
|
34289
|
-
this.#commit_callbacks.clear();
|
|
34290
|
-
}
|
|
34291
|
-
if (this.#pending === 0) {
|
|
34292
|
-
this.#commit();
|
|
34293
|
-
}
|
|
34294
|
-
}
|
|
34295
34370
|
#commit() {
|
|
34296
34371
|
if (batches.size > 1) {
|
|
34297
34372
|
this.previous.clear();
|
|
@@ -34357,7 +34432,16 @@ class Batch {
|
|
|
34357
34432
|
decrement(blocking) {
|
|
34358
34433
|
this.#pending -= 1;
|
|
34359
34434
|
if (blocking) this.#blocking_pending -= 1;
|
|
34360
|
-
this
|
|
34435
|
+
if (this.#decrement_queued) return;
|
|
34436
|
+
this.#decrement_queued = true;
|
|
34437
|
+
queue_micro_task(() => {
|
|
34438
|
+
this.#decrement_queued = false;
|
|
34439
|
+
if (!this.is_deferred()) {
|
|
34440
|
+
this.revive();
|
|
34441
|
+
} else if (queued_root_effects.length > 0) {
|
|
34442
|
+
this.flush();
|
|
34443
|
+
}
|
|
34444
|
+
});
|
|
34361
34445
|
}
|
|
34362
34446
|
revive() {
|
|
34363
34447
|
for (const e of this.#dirty_effects) {
|
|
@@ -34387,7 +34471,7 @@ class Batch {
|
|
|
34387
34471
|
const batch = current_batch = new Batch();
|
|
34388
34472
|
batches.add(current_batch);
|
|
34389
34473
|
if (!is_flushing_sync) {
|
|
34390
|
-
|
|
34474
|
+
queue_micro_task(() => {
|
|
34391
34475
|
if (current_batch !== batch) {
|
|
34392
34476
|
return;
|
|
34393
34477
|
}
|
|
@@ -34397,10 +34481,6 @@ class Batch {
|
|
|
34397
34481
|
}
|
|
34398
34482
|
return current_batch;
|
|
34399
34483
|
}
|
|
34400
|
-
/** @param {() => void} task */
|
|
34401
|
-
static enqueue(task) {
|
|
34402
|
-
queue_micro_task(task);
|
|
34403
|
-
}
|
|
34404
34484
|
apply() {
|
|
34405
34485
|
return;
|
|
34406
34486
|
}
|
|
@@ -34430,11 +34510,9 @@ function flushSync(fn) {
|
|
|
34430
34510
|
}
|
|
34431
34511
|
}
|
|
34432
34512
|
function flush_effects() {
|
|
34433
|
-
var was_updating_effect = is_updating_effect;
|
|
34434
34513
|
is_flushing = true;
|
|
34435
34514
|
try {
|
|
34436
34515
|
var flush_count = 0;
|
|
34437
|
-
set_is_updating_effect(true);
|
|
34438
34516
|
while (queued_root_effects.length > 0) {
|
|
34439
34517
|
var batch = Batch.ensure();
|
|
34440
34518
|
if (flush_count++ > 1e3) {
|
|
@@ -34448,7 +34526,6 @@ function flush_effects() {
|
|
|
34448
34526
|
}
|
|
34449
34527
|
} finally {
|
|
34450
34528
|
is_flushing = false;
|
|
34451
|
-
set_is_updating_effect(was_updating_effect);
|
|
34452
34529
|
last_scheduled_effect = null;
|
|
34453
34530
|
}
|
|
34454
34531
|
}
|
|
@@ -34530,7 +34607,7 @@ function depends_on(reaction, sources, checked) {
|
|
|
34530
34607
|
if (depends !== void 0) return depends;
|
|
34531
34608
|
if (reaction.deps !== null) {
|
|
34532
34609
|
for (const dep of reaction.deps) {
|
|
34533
|
-
if (
|
|
34610
|
+
if (includes.call(sources, dep)) {
|
|
34534
34611
|
return true;
|
|
34535
34612
|
}
|
|
34536
34613
|
if ((dep.f & DERIVED) !== 0 && depends_on(
|
|
@@ -34566,6 +34643,22 @@ function schedule_effect(signal) {
|
|
|
34566
34643
|
}
|
|
34567
34644
|
queued_root_effects.push(effect2);
|
|
34568
34645
|
}
|
|
34646
|
+
function reset_branch(effect2, tracked) {
|
|
34647
|
+
if ((effect2.f & BRANCH_EFFECT) !== 0 && (effect2.f & CLEAN) !== 0) {
|
|
34648
|
+
return;
|
|
34649
|
+
}
|
|
34650
|
+
if ((effect2.f & DIRTY) !== 0) {
|
|
34651
|
+
tracked.d.push(effect2);
|
|
34652
|
+
} else if ((effect2.f & MAYBE_DIRTY) !== 0) {
|
|
34653
|
+
tracked.m.push(effect2);
|
|
34654
|
+
}
|
|
34655
|
+
set_signal_status(effect2, CLEAN);
|
|
34656
|
+
var e = effect2.first;
|
|
34657
|
+
while (e !== null) {
|
|
34658
|
+
reset_branch(e, tracked);
|
|
34659
|
+
e = e.next;
|
|
34660
|
+
}
|
|
34661
|
+
}
|
|
34569
34662
|
function createSubscriber(start) {
|
|
34570
34663
|
let subscribers = 0;
|
|
34571
34664
|
let version2 = source(0);
|
|
@@ -34622,6 +34715,7 @@ class Boundary {
|
|
|
34622
34715
|
#pending_anchor = null;
|
|
34623
34716
|
#local_pending_count = 0;
|
|
34624
34717
|
#pending_count = 0;
|
|
34718
|
+
#pending_count_update_queued = false;
|
|
34625
34719
|
#is_creating_fallback = false;
|
|
34626
34720
|
/** @type {Set<Effect>} */
|
|
34627
34721
|
#dirty_effects = /* @__PURE__ */ new Set();
|
|
@@ -34682,11 +34776,9 @@ class Boundary {
|
|
|
34682
34776
|
}
|
|
34683
34777
|
#hydrate_pending_content() {
|
|
34684
34778
|
const pending = this.#props.pending;
|
|
34685
|
-
if (!pending)
|
|
34686
|
-
return;
|
|
34687
|
-
}
|
|
34779
|
+
if (!pending) return;
|
|
34688
34780
|
this.#pending_effect = branch(() => pending(this.#anchor));
|
|
34689
|
-
|
|
34781
|
+
queue_micro_task(() => {
|
|
34690
34782
|
var anchor = this.#get_anchor();
|
|
34691
34783
|
this.#main_effect = this.#run(() => {
|
|
34692
34784
|
Batch.ensure();
|
|
@@ -34815,9 +34907,14 @@ class Boundary {
|
|
|
34815
34907
|
update_pending_count(d2) {
|
|
34816
34908
|
this.#update_pending_count(d2);
|
|
34817
34909
|
this.#local_pending_count += d2;
|
|
34818
|
-
if (this.#effect_pending)
|
|
34819
|
-
|
|
34820
|
-
|
|
34910
|
+
if (!this.#effect_pending || this.#pending_count_update_queued) return;
|
|
34911
|
+
this.#pending_count_update_queued = true;
|
|
34912
|
+
queue_micro_task(() => {
|
|
34913
|
+
this.#pending_count_update_queued = false;
|
|
34914
|
+
if (this.#effect_pending) {
|
|
34915
|
+
internal_set(this.#effect_pending, this.#local_pending_count);
|
|
34916
|
+
}
|
|
34917
|
+
});
|
|
34821
34918
|
}
|
|
34822
34919
|
get_effect_pending() {
|
|
34823
34920
|
this.#effect_pending_subscriber();
|
|
@@ -34874,19 +34971,15 @@ class Boundary {
|
|
|
34874
34971
|
this.is_pending = false;
|
|
34875
34972
|
}
|
|
34876
34973
|
};
|
|
34877
|
-
|
|
34878
|
-
|
|
34879
|
-
|
|
34880
|
-
|
|
34881
|
-
|
|
34882
|
-
|
|
34883
|
-
|
|
34884
|
-
|
|
34885
|
-
|
|
34886
|
-
set_active_reaction(previous_reaction);
|
|
34887
|
-
}
|
|
34888
|
-
if (failed) {
|
|
34889
|
-
queue_micro_task(() => {
|
|
34974
|
+
queue_micro_task(() => {
|
|
34975
|
+
try {
|
|
34976
|
+
calling_on_error = true;
|
|
34977
|
+
onerror?.(error, reset2);
|
|
34978
|
+
calling_on_error = false;
|
|
34979
|
+
} catch (error2) {
|
|
34980
|
+
invoke_error_boundary(error2, this.#effect && this.#effect.parent);
|
|
34981
|
+
}
|
|
34982
|
+
if (failed) {
|
|
34890
34983
|
this.#failed_effect = this.#run(() => {
|
|
34891
34984
|
Batch.ensure();
|
|
34892
34985
|
this.#is_creating_fallback = true;
|
|
@@ -34909,13 +35002,14 @@ class Boundary {
|
|
|
34909
35002
|
this.#is_creating_fallback = false;
|
|
34910
35003
|
}
|
|
34911
35004
|
});
|
|
34912
|
-
}
|
|
34913
|
-
}
|
|
35005
|
+
}
|
|
35006
|
+
});
|
|
34914
35007
|
}
|
|
34915
35008
|
}
|
|
34916
35009
|
function flatten(blockers, sync, async, fn) {
|
|
34917
35010
|
const d2 = is_runes() ? derived : derived_safe_equal;
|
|
34918
|
-
|
|
35011
|
+
var pending = blockers.filter((b2) => !b2.settled);
|
|
35012
|
+
if (async.length === 0 && pending.length === 0) {
|
|
34919
35013
|
fn(sync.map(d2));
|
|
34920
35014
|
return;
|
|
34921
35015
|
}
|
|
@@ -34925,32 +35019,29 @@ function flatten(blockers, sync, async, fn) {
|
|
|
34925
35019
|
active_effect
|
|
34926
35020
|
);
|
|
34927
35021
|
var restore = capture();
|
|
34928
|
-
|
|
34929
|
-
|
|
34930
|
-
|
|
34931
|
-
|
|
34932
|
-
|
|
34933
|
-
|
|
34934
|
-
|
|
34935
|
-
|
|
34936
|
-
}
|
|
35022
|
+
var blocker_promise = pending.length === 1 ? pending[0].promise : pending.length > 1 ? Promise.all(pending.map((b2) => b2.promise)) : null;
|
|
35023
|
+
function finish(values) {
|
|
35024
|
+
restore();
|
|
35025
|
+
try {
|
|
35026
|
+
fn(values);
|
|
35027
|
+
} catch (error) {
|
|
35028
|
+
if ((parent.f & DESTROYED) === 0) {
|
|
35029
|
+
invoke_error_boundary(error, parent);
|
|
34937
35030
|
}
|
|
34938
|
-
|
|
34939
|
-
|
|
34940
|
-
|
|
34941
|
-
invoke_error_boundary(error, parent);
|
|
34942
|
-
});
|
|
35031
|
+
}
|
|
35032
|
+
batch?.deactivate();
|
|
35033
|
+
unset_context();
|
|
34943
35034
|
}
|
|
34944
|
-
if (
|
|
34945
|
-
|
|
34946
|
-
|
|
34947
|
-
|
|
34948
|
-
|
|
34949
|
-
|
|
34950
|
-
|
|
34951
|
-
|
|
34952
|
-
|
|
34953
|
-
|
|
35035
|
+
if (async.length === 0) {
|
|
35036
|
+
blocker_promise.then(() => finish(sync.map(d2)));
|
|
35037
|
+
return;
|
|
35038
|
+
}
|
|
35039
|
+
function run3() {
|
|
35040
|
+
restore();
|
|
35041
|
+
Promise.all(async.map((expression) => /* @__PURE__ */ async_derived(expression))).then((result) => finish([...sync.map(d2), ...result])).catch((error) => invoke_error_boundary(error, parent));
|
|
35042
|
+
}
|
|
35043
|
+
if (blocker_promise) {
|
|
35044
|
+
blocker_promise.then(run3);
|
|
34954
35045
|
} else {
|
|
34955
35046
|
run3();
|
|
34956
35047
|
}
|
|
@@ -35212,7 +35303,7 @@ function mutate(source2, value) {
|
|
|
35212
35303
|
function set(source2, value, should_proxy = false) {
|
|
35213
35304
|
if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
35214
35305
|
// to ensure we error if state is set inside an inspect effect
|
|
35215
|
-
(!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 && !
|
|
35306
|
+
(!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 && (current_sources === null || !includes.call(current_sources, source2))) {
|
|
35216
35307
|
state_unsafe_mutation();
|
|
35217
35308
|
}
|
|
35218
35309
|
let new_value = should_proxy ? proxy(value) : value;
|
|
@@ -35256,20 +35347,13 @@ function internal_set(source2, value) {
|
|
|
35256
35347
|
}
|
|
35257
35348
|
function flush_eager_effects() {
|
|
35258
35349
|
eager_effects_deferred = false;
|
|
35259
|
-
|
|
35260
|
-
|
|
35261
|
-
|
|
35262
|
-
|
|
35263
|
-
|
|
35264
|
-
|
|
35265
|
-
set_signal_status(effect2, MAYBE_DIRTY);
|
|
35266
|
-
}
|
|
35267
|
-
if (is_dirty(effect2)) {
|
|
35268
|
-
update_effect(effect2);
|
|
35269
|
-
}
|
|
35350
|
+
for (const effect2 of eager_effects) {
|
|
35351
|
+
if ((effect2.f & CLEAN) !== 0) {
|
|
35352
|
+
set_signal_status(effect2, MAYBE_DIRTY);
|
|
35353
|
+
}
|
|
35354
|
+
if (is_dirty(effect2)) {
|
|
35355
|
+
update_effect(effect2);
|
|
35270
35356
|
}
|
|
35271
|
-
} finally {
|
|
35272
|
-
set_is_updating_effect(prev_is_updating_effect);
|
|
35273
35357
|
}
|
|
35274
35358
|
eager_effects.clear();
|
|
35275
35359
|
}
|
|
@@ -36020,9 +36104,6 @@ function invalidate_inner_signals(fn) {
|
|
|
36020
36104
|
}
|
|
36021
36105
|
}
|
|
36022
36106
|
let is_updating_effect = false;
|
|
36023
|
-
function set_is_updating_effect(value) {
|
|
36024
|
-
is_updating_effect = value;
|
|
36025
|
-
}
|
|
36026
36107
|
let is_destroying_effect = false;
|
|
36027
36108
|
function set_is_destroying_effect(value) {
|
|
36028
36109
|
is_destroying_effect = value;
|
|
@@ -36101,7 +36182,7 @@ function is_dirty(reaction) {
|
|
|
36101
36182
|
function schedule_possible_effect_self_invalidation(signal, effect2, root2 = true) {
|
|
36102
36183
|
var reactions = signal.reactions;
|
|
36103
36184
|
if (reactions === null) return;
|
|
36104
|
-
if (current_sources
|
|
36185
|
+
if (current_sources !== null && includes.call(current_sources, signal)) {
|
|
36105
36186
|
return;
|
|
36106
36187
|
}
|
|
36107
36188
|
for (var i = 0; i < reactions.length; i++) {
|
|
@@ -36159,9 +36240,12 @@ function update_reaction(reaction) {
|
|
|
36159
36240
|
);
|
|
36160
36241
|
var result = fn();
|
|
36161
36242
|
var deps = reaction.deps;
|
|
36243
|
+
var is_fork = current_batch?.is_fork;
|
|
36162
36244
|
if (new_deps !== null) {
|
|
36163
36245
|
var i;
|
|
36164
|
-
|
|
36246
|
+
if (!is_fork) {
|
|
36247
|
+
remove_reactions(reaction, skipped_deps);
|
|
36248
|
+
}
|
|
36165
36249
|
if (deps !== null && skipped_deps > 0) {
|
|
36166
36250
|
deps.length = skipped_deps + new_deps.length;
|
|
36167
36251
|
for (i = 0; i < new_deps.length; i++) {
|
|
@@ -36175,7 +36259,7 @@ function update_reaction(reaction) {
|
|
|
36175
36259
|
(deps[i].reactions ??= []).push(reaction);
|
|
36176
36260
|
}
|
|
36177
36261
|
}
|
|
36178
|
-
} else if (deps !== null && skipped_deps < deps.length) {
|
|
36262
|
+
} else if (!is_fork && deps !== null && skipped_deps < deps.length) {
|
|
36179
36263
|
remove_reactions(reaction, skipped_deps);
|
|
36180
36264
|
deps.length = skipped_deps;
|
|
36181
36265
|
}
|
|
@@ -36245,7 +36329,7 @@ function remove_reaction(signal, dependency) {
|
|
|
36245
36329
|
if (reactions === null && (dependency.f & DERIVED) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
36246
36330
|
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
36247
36331
|
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
36248
|
-
(new_deps === null || !
|
|
36332
|
+
(new_deps === null || !includes.call(new_deps, dependency))) {
|
|
36249
36333
|
var derived2 = (
|
|
36250
36334
|
/** @type {Derived} */
|
|
36251
36335
|
dependency
|
|
@@ -36303,7 +36387,7 @@ function get2(signal) {
|
|
|
36303
36387
|
captured_signals?.add(signal);
|
|
36304
36388
|
if (active_reaction !== null && !untracking) {
|
|
36305
36389
|
var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;
|
|
36306
|
-
if (!destroyed && !
|
|
36390
|
+
if (!destroyed && (current_sources === null || !includes.call(current_sources, signal))) {
|
|
36307
36391
|
var deps = active_reaction.deps;
|
|
36308
36392
|
if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {
|
|
36309
36393
|
if (signal.rv < read_version) {
|
|
@@ -36321,7 +36405,7 @@ function get2(signal) {
|
|
|
36321
36405
|
var reactions = signal.reactions;
|
|
36322
36406
|
if (reactions === null) {
|
|
36323
36407
|
signal.reactions = [active_reaction];
|
|
36324
|
-
} else if (!
|
|
36408
|
+
} else if (!includes.call(reactions, active_reaction)) {
|
|
36325
36409
|
reactions.push(active_reaction);
|
|
36326
36410
|
}
|
|
36327
36411
|
}
|
|
@@ -37159,11 +37243,17 @@ function each(node, flags2, get_collection, get_key, render_fn, fallback_fn = nu
|
|
|
37159
37243
|
var state2 = { effect: effect2, items, outrogroups: null, fallback };
|
|
37160
37244
|
first_run = false;
|
|
37161
37245
|
}
|
|
37246
|
+
function skip_to_branch(effect2) {
|
|
37247
|
+
while (effect2 !== null && (effect2.f & BRANCH_EFFECT) === 0) {
|
|
37248
|
+
effect2 = effect2.next;
|
|
37249
|
+
}
|
|
37250
|
+
return effect2;
|
|
37251
|
+
}
|
|
37162
37252
|
function reconcile(state2, array, anchor, flags2, get_key) {
|
|
37163
37253
|
var is_animated = (flags2 & EACH_IS_ANIMATED) !== 0;
|
|
37164
37254
|
var length = array.length;
|
|
37165
37255
|
var items = state2.items;
|
|
37166
|
-
var current = state2.effect.first;
|
|
37256
|
+
var current = skip_to_branch(state2.effect.first);
|
|
37167
37257
|
var seen;
|
|
37168
37258
|
var prev = null;
|
|
37169
37259
|
var to_animate;
|
|
@@ -37213,7 +37303,7 @@ function reconcile(state2, array, anchor, flags2, get_key) {
|
|
|
37213
37303
|
prev = effect2;
|
|
37214
37304
|
matched = [];
|
|
37215
37305
|
stashed = [];
|
|
37216
|
-
current = prev.next;
|
|
37306
|
+
current = skip_to_branch(prev.next);
|
|
37217
37307
|
continue;
|
|
37218
37308
|
}
|
|
37219
37309
|
}
|
|
@@ -37261,7 +37351,7 @@ function reconcile(state2, array, anchor, flags2, get_key) {
|
|
|
37261
37351
|
while (current !== null && current !== effect2) {
|
|
37262
37352
|
(seen ??= /* @__PURE__ */ new Set()).add(current);
|
|
37263
37353
|
stashed.push(current);
|
|
37264
|
-
current = current.next;
|
|
37354
|
+
current = skip_to_branch(current.next);
|
|
37265
37355
|
}
|
|
37266
37356
|
if (current === null) {
|
|
37267
37357
|
continue;
|
|
@@ -37271,7 +37361,7 @@ function reconcile(state2, array, anchor, flags2, get_key) {
|
|
|
37271
37361
|
matched.push(effect2);
|
|
37272
37362
|
}
|
|
37273
37363
|
prev = effect2;
|
|
37274
|
-
current = effect2.next;
|
|
37364
|
+
current = skip_to_branch(effect2.next);
|
|
37275
37365
|
}
|
|
37276
37366
|
if (state2.outrogroups !== null) {
|
|
37277
37367
|
for (const group of state2.outrogroups) {
|
|
@@ -37297,7 +37387,7 @@ function reconcile(state2, array, anchor, flags2, get_key) {
|
|
|
37297
37387
|
if ((current.f & INERT) === 0 && current !== state2.fallback) {
|
|
37298
37388
|
to_destroy.push(current);
|
|
37299
37389
|
}
|
|
37300
|
-
current = current.next;
|
|
37390
|
+
current = skip_to_branch(current.next);
|
|
37301
37391
|
}
|
|
37302
37392
|
var destroy_length = to_destroy.length;
|
|
37303
37393
|
if (destroy_length > 0) {
|