@samva/vite 0.18.0 → 0.19.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.
Files changed (65) hide show
  1. package/AGENTS.md +5 -2
  2. package/CHANGELOG.md +28 -0
  3. package/README.md +41 -0
  4. package/dist/{brand-BkXQMGgY.d.ts → brand-q80zlW2d.d.ts} +4 -2
  5. package/dist/build.d.ts +1 -1
  6. package/dist/build.js +4 -4
  7. package/dist/dev.d.ts +2 -2
  8. package/dist/dev.js +1 -1
  9. package/dist/editor/assets/index-D2Eh4--j.css +2 -0
  10. package/dist/editor/assets/index-mDq6Sihj.js +184 -0
  11. package/dist/editor/index.html +2 -2
  12. package/dist/editor/licenses/character-entities-legacy.md +22 -0
  13. package/dist/editor/licenses/character-reference-invalid.md +22 -0
  14. package/dist/editor/licenses/css-tree.md +19 -0
  15. package/dist/editor/licenses/decode-named-character-reference.md +22 -0
  16. package/dist/editor/licenses/devlop.md +22 -0
  17. package/dist/editor/licenses/estree-util-is-identifier-name.md +22 -0
  18. package/dist/editor/licenses/estree-util-visit.md +22 -0
  19. package/dist/editor/licenses/is-alphabetical.md +22 -0
  20. package/dist/editor/licenses/is-alphanumerical.md +22 -0
  21. package/dist/editor/licenses/is-decimal.md +22 -0
  22. package/dist/editor/licenses/is-hexadecimal.md +22 -0
  23. package/dist/editor/licenses/mdast-util-from-markdown.md +22 -0
  24. package/dist/editor/licenses/mdast-util-mdx-expression.md +22 -0
  25. package/dist/editor/licenses/mdast-util-mdx-jsx.md +22 -0
  26. package/dist/editor/licenses/mdast-util-to-string.md +22 -0
  27. package/dist/editor/licenses/micromark-core-commonmark.md +22 -0
  28. package/dist/editor/licenses/micromark-extension-mdx-expression.md +22 -0
  29. package/dist/editor/licenses/micromark-extension-mdx-jsx.md +22 -0
  30. package/dist/editor/licenses/micromark-factory-destination.md +22 -0
  31. package/dist/editor/licenses/micromark-factory-label.md +22 -0
  32. package/dist/editor/licenses/micromark-factory-mdx-expression.md +22 -0
  33. package/dist/editor/licenses/micromark-factory-space.md +22 -0
  34. package/dist/editor/licenses/micromark-factory-title.md +22 -0
  35. package/dist/editor/licenses/micromark-factory-whitespace.md +22 -0
  36. package/dist/editor/licenses/micromark-util-character.md +22 -0
  37. package/dist/editor/licenses/micromark-util-chunked.md +22 -0
  38. package/dist/editor/licenses/micromark-util-classify-character.md +22 -0
  39. package/dist/editor/licenses/micromark-util-combine-extensions.md +22 -0
  40. package/dist/editor/licenses/micromark-util-decode-numeric-character-reference.md +22 -0
  41. package/dist/editor/licenses/micromark-util-decode-string.md +22 -0
  42. package/dist/editor/licenses/micromark-util-edit-map.md +22 -0
  43. package/dist/editor/licenses/micromark-util-events-to-acorn.md +22 -0
  44. package/dist/editor/licenses/micromark-util-html-tag-name.md +22 -0
  45. package/dist/editor/licenses/micromark-util-normalize-identifier.md +22 -0
  46. package/dist/editor/licenses/micromark-util-resolve-all.md +22 -0
  47. package/dist/editor/licenses/micromark-util-subtokenize.md +22 -0
  48. package/dist/editor/licenses/micromark.md +22 -0
  49. package/dist/editor/licenses/parse-entities.md +22 -0
  50. package/dist/editor/licenses/source-map-js.md +28 -0
  51. package/dist/editor/licenses/unist-util-position-from-estree.md +22 -0
  52. package/dist/editor/licenses/unist-util-stringify-position.md +22 -0
  53. package/dist/editor/licenses/vfile-message.md +22 -0
  54. package/dist/editor/licenses/yaml.md +13 -0
  55. package/dist/{editor-CXu5ksXm.js → editor-CXbIfm3N.js} +1 -1
  56. package/dist/{editor-DfdlKEeu.d.ts → editor-DqMrfMrR.d.ts} +1 -1
  57. package/dist/index.d.ts +2 -2
  58. package/dist/index.js +1 -1
  59. package/dist/{project-BDIqD8ho.js → project-l7pOcW8X.js} +73 -15
  60. package/dist/project.d.ts +13 -2
  61. package/dist/project.js +2 -2
  62. package/dist/render.js +4 -4
  63. package/package.json +3 -3
  64. package/dist/editor/assets/index-CIlSV4Yp.js +0 -39
  65. package/dist/editor/assets/index-DRZO63Mg.css +0 -2
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <mailto:tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,28 @@
1
+
2
+ Copyright (c) 2009-2011, Mozilla Foundation and contributors
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ * Neither the names of the Mozilla Foundation nor the names of project
16
+ contributors may be used to endorse or promote products derived from this
17
+ software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2021 Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,13 @@
1
+ Copyright Eemeli Aro <eemeli@gmail.com>
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any purpose
4
+ with or without fee is hereby granted, provided that the above copyright notice
5
+ and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
9
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
11
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
12
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
13
+ THIS SOFTWARE.
@@ -1,4 +1,4 @@
1
- import { C as renderEmailFixtures, S as renderChannelFixture, c as restoreBase, f as isProjectFile, g as templateDirectories, i as loadProject, m as projectPath, o as compileBase, p as isWithin, y as emailCompatibility } from "./project-BDIqD8ho.js";
1
+ import { C as renderChannelFixture, _ as templateDirectories, b as emailCompatibility, c as restoreBase, h as projectPath, i as loadProject, m as isWithin, o as compileBase, p as isProjectFile, w as renderEmailFixtures } from "./project-l7pOcW8X.js";
2
2
  import { existsSync } from "node:fs";
3
3
  import { open, readFile, realpath, rename, rm, stat } from "node:fs/promises";
4
4
  import { isIP } from "node:net";
@@ -1,4 +1,4 @@
1
- import { n as BrandResolver } from "./brand-BkXQMGgY.js";
1
+ import { n as BrandResolver } from "./brand-q80zlW2d.js";
2
2
  import { BrandPlugin } from "@samva/markup/brand";
3
3
  import { Plugin } from "vite";
4
4
  //#region src/editor.d.ts
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { i as ResolvedBrand, n as BrandResolver, r as BrandWarning, t as BrandResolution } from "./brand-BkXQMGgY.js";
2
- import { n as SamvaEditorPluginOptions, r as samvaEditor, t as EditorAffordances } from "./editor-DfdlKEeu.js";
1
+ import { i as ResolvedBrand, n as BrandResolver, r as BrandWarning, t as BrandResolution } from "./brand-q80zlW2d.js";
2
+ import { n as SamvaEditorPluginOptions, r as samvaEditor, t as EditorAffordances } from "./editor-DqMrfMrR.js";
3
3
  export { type BrandResolution, type BrandResolver, type BrandWarning, type EditorAffordances, type ResolvedBrand, type SamvaEditorPluginOptions, samvaEditor };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as samvaEditor } from "./editor-CXu5ksXm.js";
1
+ import { t as samvaEditor } from "./editor-CXbIfm3N.js";
2
2
  export { samvaEditor };
@@ -3,6 +3,7 @@ import { mkdir, readFile, readdir, stat, writeFile } from "node:fs/promises";
3
3
  import { isAbsolute, join, relative, resolve, sep } from "node:path";
4
4
  import { TEMPLATE_NAME_PATTERN, compileTemplate, projectBrandSpecifier } from "@samva/markup/compiler";
5
5
  import { checkCompatibility } from "@samva/markup/compatibility";
6
+ import { compileIssue } from "@samva/markup/markdown";
6
7
  import { render } from "@samva/markup/render";
7
8
  import { assetUrl, isAssetPath } from "@samva/markup/brand";
8
9
  //#region src/brand.ts
@@ -116,6 +117,7 @@ const compileProject = async (input) => {
116
117
  const failures = [];
117
118
  const helpers = [];
118
119
  const diagnostics = [];
120
+ const issues = [];
119
121
  const assets = /* @__PURE__ */ new Map();
120
122
  const declaredBy = /* @__PURE__ */ new Map();
121
123
  for (const result of results) {
@@ -137,9 +139,55 @@ const compileProject = async (input) => {
137
139
  for (const asset of entry.assets) assets.set(asset.digest, asset);
138
140
  templates.push(entry);
139
141
  }
142
+ const slugs = /* @__PURE__ */ new Map();
143
+ const issueResults = await Promise.all((input.issues ?? []).toSorted().map(async (entryPath) => {
144
+ return {
145
+ entryPath,
146
+ compiled: await compileIssue({
147
+ files: input.files,
148
+ entry: entryPath,
149
+ layout: input.issueLayout,
150
+ assetBase: input.assetBase,
151
+ brandPlugin: input.brandPlugin,
152
+ ...input.brand === void 0 ? {} : { brand: input.brand },
153
+ tailwind: input.theme === void 0 ? {} : {
154
+ css: input.theme.css,
155
+ cssPath: input.theme.path
156
+ }
157
+ })
158
+ };
159
+ }));
160
+ for (const { entryPath, compiled } of issueResults) {
161
+ if (compiled.template === void 0 || compiled.frontmatter === void 0) {
162
+ failures.push({
163
+ entryPath,
164
+ diagnostics: compiled.diagnostics
165
+ });
166
+ continue;
167
+ }
168
+ const previous = slugs.get(compiled.frontmatter.slug);
169
+ if (previous !== void 0) {
170
+ diagnostics.push(finding("duplicate-issue-slug", "error", `Issue slug ${JSON.stringify(compiled.frontmatter.slug)} is declared by both ${previous} and ${entryPath}.`));
171
+ continue;
172
+ }
173
+ slugs.set(compiled.frontmatter.slug, entryPath);
174
+ for (const asset of compiled.assets) assets.set(asset.digest, asset);
175
+ issues.push({
176
+ id: compiled.frontmatter.slug,
177
+ entryPath,
178
+ compiled: compiled.template,
179
+ fixtures: compiled.fixtures,
180
+ frontmatter: compiled.frontmatter,
181
+ assets: compiled.assets,
182
+ diagnostics: compiled.diagnostics,
183
+ channels: channelsOf(compiled.template),
184
+ brandPlugin: input.brandPlugin
185
+ });
186
+ }
140
187
  return {
141
188
  templates: templates.sort((left, right) => left.id < right.id ? -1 : 1),
142
- failures,
189
+ issues,
190
+ failures: failures.toSorted((a, b) => a.entryPath.localeCompare(b.entryPath)),
143
191
  helpers,
144
192
  diagnostics,
145
193
  assets: [...assets.values()].sort((left, right) => left.fileName < right.fileName ? -1 : 1)
@@ -162,7 +210,7 @@ const renderEmailFixtures = (entry, options = {}) => Object.entries(entry.fixtur
162
210
  templateId: entry.id,
163
211
  fixture,
164
212
  rendered: render(entry.compiled, input, {
165
- channel: "email",
213
+ target: "email",
166
214
  ...options,
167
215
  ...entry.brandPlugin === void 0 ? {} : { brandPlugin: entry.brandPlugin }
168
216
  }),
@@ -191,14 +239,14 @@ const renderChannelFixture = (entry, channel, fixture, options = {}) => {
191
239
  ok: true,
192
240
  channel,
193
241
  text: render(entry.compiled, input, {
194
- channel,
242
+ target: channel,
195
243
  ...options
196
244
  }).text
197
245
  } : {
198
246
  ok: true,
199
247
  channel,
200
248
  message: render(entry.compiled, input, {
201
- channel,
249
+ target: channel,
202
250
  ...options
203
251
  })
204
252
  };
@@ -220,7 +268,7 @@ const toPosix = (value) => sep === "/" ? value : value.split(sep).join("/");
220
268
  const SCRIPT = /\.[cm]?[jt]sx?$/;
221
269
  const isProjectText = (name) => SCRIPT.test(name) || name.endsWith(".css") || name.endsWith(".json");
222
270
  /** True for a file a compile can read: scripts, stylesheets, JSON and importable assets. */
223
- const isProjectFile = (path) => isProjectText(path) || isAssetPath(path);
271
+ const isProjectFile = (path) => isProjectText(path) || isAssetPath(path) || path.startsWith("issues/") && path.endsWith(".md");
224
272
  const skipped = (name) => name.startsWith(".") || name === "node_modules";
225
273
  /** True when `path` is `parent` or lies beneath it. */
226
274
  const isWithin = (path, parent) => {
@@ -248,14 +296,14 @@ const templateDirectories = async (root, dir) => {
248
296
  /** Root-relative POSIX path of an absolute one. */
249
297
  const projectPath = (root, path) => toPosix(relative(root, path));
250
298
  /** Every `.tsx` file beneath the given directories, as root-relative paths, sorted. */
251
- const discoverEntries = async (root, dirs) => {
299
+ const discoverEntries = async (root, dirs, extension = ".tsx") => {
252
300
  const found = [];
253
301
  const walk = async (current) => {
254
302
  const entries = await readdir(current, { withFileTypes: true }).catch(() => []);
255
303
  await Promise.all(entries.filter((entry) => !skipped(entry.name)).map(async (entry) => {
256
304
  const full = join(current, entry.name);
257
305
  if (entry.isDirectory()) return walk(full);
258
- if (entry.isFile() && entry.name.endsWith(".tsx")) found.push(projectPath(root, full));
306
+ if (entry.isFile() && entry.name.endsWith(extension)) found.push(projectPath(root, full));
259
307
  }));
260
308
  };
261
309
  await Promise.all(dirs.map(walk));
@@ -276,12 +324,14 @@ const readProjectFiles = async (root) => {
276
324
  if (!entry.isFile()) return;
277
325
  const path = projectPath(root, full);
278
326
  if (isAssetPath(path)) files[path] = new Uint8Array(await readFile(full));
279
- else if (isProjectText(entry.name)) files[path] = await readFile(full, "utf8");
327
+ else if (isProjectText(entry.name) || path.startsWith("issues/") && path.endsWith(".md")) files[path] = await readFile(full, "utf8");
280
328
  }));
281
329
  };
282
330
  await walk(root);
283
331
  return files;
284
332
  };
333
+ /** Issue documents are discovered independently of registered TSX template entries. */
334
+ const discoverIssues = async (root) => discoverEntries(root, [join(root, "issues")], ".md");
285
335
  //#endregion
286
336
  //#region src/local-assets.ts
287
337
  const HTTPS = /^https:\/\//i;
@@ -321,8 +371,14 @@ const projectRoot = (options) => resolve(options.root ?? process.cwd());
321
371
  const loadProject = async (options = {}, only) => {
322
372
  const root = projectRoot(options);
323
373
  const dirs = await templateDirectories(root, options.dir);
324
- const [discovered, files] = await Promise.all([discoverEntries(root, dirs), readProjectFiles(root)]);
325
- const entries = only === void 0 ? discovered : discovered.filter((path) => only.includes(path));
374
+ const [discovered, issuePaths, files] = await Promise.all([
375
+ discoverEntries(root, dirs),
376
+ discoverIssues(root),
377
+ readProjectFiles(root)
378
+ ]);
379
+ const issueLayout = projectPath(root, resolve(root, options.issueLayout ?? "layout.tsx"));
380
+ const hasIssueLayout = options.issueLayout !== void 0 || issuePaths.length > 0;
381
+ const entries = discovered.filter((path) => (!hasIssueLayout || path !== issueLayout) && (only === void 0 || only.includes(path)));
326
382
  const themeFile = resolveThemePath(root, options.theme);
327
383
  const themeCss = await readProjectThemeCss(themeFile);
328
384
  const themePath = themeFile === void 0 || themeCss === void 0 ? void 0 : projectThemePath(root, themeFile);
@@ -330,6 +386,8 @@ const loadProject = async (options = {}, only) => {
330
386
  const catalog = await compileProject({
331
387
  files,
332
388
  entries,
389
+ issues: only === void 0 ? issuePaths : issuePaths.filter((path) => only.includes(path)),
390
+ issueLayout,
333
391
  assetBase: options.assetBase ?? "",
334
392
  brandPlugin: options.brandPlugin,
335
393
  ...themeCss === void 0 || themePath === void 0 ? {} : { theme: {
@@ -429,11 +487,11 @@ const exportProject = async (input) => {
429
487
  const diagnostics = [
430
488
  ...project.diagnostics,
431
489
  ...catalog.failures.flatMap((failure) => failure.diagnostics),
432
- ...catalog.templates.flatMap((entry) => entry.diagnostics)
490
+ ...[...catalog.templates, ...catalog.issues].flatMap((entry) => entry.diagnostics)
433
491
  ];
434
492
  const templates = [];
435
- for (const entry of catalog.templates) {
436
- const directory = exportPath(out, "templates", entry.id);
493
+ for (const entry of [...catalog.templates, ...catalog.issues]) {
494
+ const directory = exportPath(out, entry.entryPath.endsWith(".md") ? "issues" : "templates", entry.id);
437
495
  if (directory === void 0) {
438
496
  diagnostics.push(unsafeExportName("Template id", entry.id));
439
497
  continue;
@@ -443,7 +501,7 @@ const exportProject = async (input) => {
443
501
  const exported = [];
444
502
  for (const fixture of Object.keys(entry.fixtures)) {
445
503
  const write = async (name, content) => {
446
- const path = exportPath(out, "templates", entry.id, name);
504
+ const path = exportPath(out, entry.entryPath.endsWith(".md") ? "issues" : "templates", entry.id, name);
447
505
  if (path === void 0) {
448
506
  diagnostics.push(unsafeExportName("Fixture name", fixture));
449
507
  return;
@@ -500,4 +558,4 @@ const exportProject = async (input) => {
500
558
  return receipt;
501
559
  };
502
560
  //#endregion
503
- export { renderEmailFixtures as C, renderChannelFixture as S, channelsOf as _, projectRoot as a, finding as b, restoreBase as c, discoverEntries as d, isProjectFile as f, templateDirectories as g, readProjectFiles as h, loadProject as i, DEFAULT_TEMPLATE_DIRS as l, projectPath as m, createProjectSession as n, compileBase as o, isWithin as p, exportProject as r, isDeliverableBase as s, DEFAULT_EXPORT_ASSET_BASE as t, SAMVA_DIR as u, compileProject as v, brandDiagnostics as w, hasErrors as x, emailCompatibility as y };
561
+ export { renderChannelFixture as C, hasErrors as S, brandDiagnostics as T, templateDirectories as _, projectRoot as a, emailCompatibility as b, restoreBase as c, discoverEntries as d, discoverIssues as f, readProjectFiles as g, projectPath as h, loadProject as i, DEFAULT_TEMPLATE_DIRS as l, isWithin as m, createProjectSession as n, compileBase as o, isProjectFile as p, exportProject as r, isDeliverableBase as s, DEFAULT_EXPORT_ASSET_BASE as t, SAMVA_DIR as u, channelsOf as v, renderEmailFixtures as w, finding as x, compileProject as y };
package/dist/project.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { a as DEFAULT_TEMPLATE_DIRS, c as discoverEntries, i as ResolvedBrand, l as readProjectFiles, n as BrandResolver, o as ProjectFiles, r as BrandWarning, s as SAMVA_DIR, t as BrandResolution, u as templateDirectories } from "./brand-BkXQMGgY.js";
1
+ import { a as DEFAULT_TEMPLATE_DIRS, c as discoverEntries, d as templateDirectories, i as ResolvedBrand, l as discoverIssues, n as BrandResolver, o as ProjectFiles, r as BrandWarning, s as SAMVA_DIR, t as BrandResolution, u as readProjectFiles } from "./brand-q80zlW2d.js";
2
+ import { IssueFrontmatter } from "@samva/markup/markdown";
2
3
  import { CompiledTemplate, RenderedEmail, RenderedWhatsApp } from "@samva/markup/render";
3
4
  import { AssetEntry, BrandPlugin } from "@samva/markup/brand";
4
5
  import { EmailDiagnostic } from "@samva/markup/diagnostics";
@@ -21,6 +22,10 @@ interface CompiledEntry {
21
22
  readonly channels: readonly TemplateChannel[];
22
23
  readonly brandPlugin?: BrandPlugin | undefined;
23
24
  }
25
+ /** A path-discovered newsletter issue, compiled inside its TSX layout. */
26
+ interface CompiledIssue extends CompiledEntry {
27
+ readonly frontmatter: IssueFrontmatter;
28
+ }
24
29
  /** An entry that is a template but did not compile. */
25
30
  interface FailedEntry {
26
31
  readonly entryPath: string;
@@ -29,6 +34,8 @@ interface FailedEntry {
29
34
  interface CompiledProject {
30
35
  /** Sorted by id. */
31
36
  readonly templates: readonly CompiledEntry[];
37
+ /** Path-discovered issues; they are not registered template entries. */
38
+ readonly issues: readonly CompiledIssue[];
32
39
  /** Entries that declare a template and did not compile, sorted by path. */
33
40
  readonly failures: readonly FailedEntry[];
34
41
  /** Candidate entries that declare no template: ordinary modules, partials and components. */
@@ -42,6 +49,8 @@ interface CompileProjectInput {
42
49
  readonly files: ProjectFiles;
43
50
  /** Candidate entries, project-relative. */
44
51
  readonly entries: readonly string[];
52
+ readonly issues?: readonly string[] | undefined;
53
+ readonly issueLayout?: string | undefined;
45
54
  /**
46
55
  * Where imported assets are served from. Empty is deliberately invalid for
47
56
  * assets: no invented serving origin. A project that imports none needs none.
@@ -108,6 +117,8 @@ interface ProjectOptions {
108
117
  * scanned; otherwise `templates/` and `emails/` are, whichever exist.
109
118
  */
110
119
  readonly dir?: string | undefined;
120
+ /** TSX layout for issues/*.md; default layout.tsx at the project root. */
121
+ readonly issueLayout?: string | undefined;
111
122
  /** Host-owned brand resolution. Brand imports fail when no resolver is supplied. */
112
123
  readonly brandResolver?: BrandResolver | undefined;
113
124
  /** Brand import specifier and footer markers passed to the compiler. */
@@ -195,4 +206,4 @@ declare const exportProject: (input: ProjectOptions & {
195
206
  readonly out: string;
196
207
  }) => Promise<ProjectExportReceipt>;
197
208
  //#endregion
198
- export { type BrandResolution, type BrandResolver, type BrandWarning, CompileProjectInput, CompiledEntry, CompiledProject, DEFAULT_EXPORT_ASSET_BASE, DEFAULT_TEMPLATE_DIRS, ExportedFixture, FailedEntry, FixtureRenderOptions, LoadedProject, ProjectExportReceipt, type ProjectFiles, ProjectOptions, ProjectSession, RenderedChannel, RenderedFixture, type ResolvedBrand, SAMVA_DIR, TemplateChannel, channelsOf, compileProject, createProjectSession, discoverEntries, emailCompatibility, exportProject, finding, hasErrors, loadProject, projectRoot, readProjectFiles, renderChannelFixture, renderEmailFixtures, templateDirectories };
209
+ export { type BrandResolution, type BrandResolver, type BrandWarning, CompileProjectInput, CompiledEntry, CompiledIssue, CompiledProject, DEFAULT_EXPORT_ASSET_BASE, DEFAULT_TEMPLATE_DIRS, ExportedFixture, FailedEntry, FixtureRenderOptions, LoadedProject, ProjectExportReceipt, type ProjectFiles, ProjectOptions, ProjectSession, RenderedChannel, RenderedFixture, type ResolvedBrand, SAMVA_DIR, TemplateChannel, channelsOf, compileProject, createProjectSession, discoverEntries, discoverIssues, emailCompatibility, exportProject, finding, hasErrors, loadProject, projectRoot, readProjectFiles, renderChannelFixture, renderEmailFixtures, templateDirectories };