@prismicio/svelte 0.0.6 → 0.0.8-dev.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/dist/__PRODUCTION__.d.ts +7 -0
- package/dist/__PRODUCTION__.js +11 -0
- package/dist/components/PrismicEmbed.svelte +26 -0
- package/{lib → dist}/components/PrismicEmbed.svelte.d.ts +11 -1
- package/dist/components/PrismicImage.svelte +90 -0
- package/dist/components/PrismicImage.svelte.d.ts +71 -0
- package/dist/components/PrismicRichText/DefaultComponent.svelte +51 -0
- package/dist/components/PrismicRichText/DefaultComponent.svelte.d.ts +21 -0
- package/dist/components/PrismicRichText/PrismicRichText.svelte +49 -0
- package/dist/components/PrismicRichText/PrismicRichText.svelte.d.ts +53 -0
- package/dist/components/PrismicRichText/Serialize.svelte +19 -0
- package/dist/components/PrismicRichText/Serialize.svelte.d.ts +21 -0
- package/dist/components/PrismicText.svelte +22 -0
- package/{lib → dist}/components/PrismicText.svelte.d.ts +14 -2
- package/dist/components/SliceZone.svelte +59 -0
- package/dist/components/SliceZone.svelte.d.ts +60 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/src/lib/__PRODUCTION__.ts +12 -0
- package/dist/src/lib/components/PrismicEmbed.svelte +29 -0
- package/dist/src/lib/components/PrismicImage.svelte +178 -0
- package/{src → dist/src}/lib/components/PrismicLink.svelte +1 -0
- package/dist/src/lib/components/PrismicRichText/DefaultComponent.svelte +56 -0
- package/dist/src/lib/components/PrismicRichText/PrismicRichText.svelte +69 -0
- package/dist/src/lib/components/PrismicRichText/Serialize.svelte +30 -0
- package/dist/src/lib/components/PrismicText.svelte +29 -0
- package/{src → dist/src}/lib/components/SliceZone.svelte +47 -1
- package/dist/src/lib/components/index.ts +11 -0
- package/dist/src/lib/index.ts +9 -0
- package/{src → dist/src}/routes/+page.server.ts +1 -1
- package/dist/src/routes/+page.svelte +61 -0
- package/dist/src/routes/components/Emphasis.svelte +3 -0
- package/dist/src/routes/components/index.js +1 -0
- package/dist/src/routes/slices/RichText/index.svelte +9 -0
- package/{src → dist/src}/types/ExampleDocument.type.ts +2 -0
- package/{src → dist/src}/types/index.ts +0 -2
- package/package.json +144 -77
- package/CHANGELOG.md +0 -77
- package/PrismicProvider.svelte +0 -21
- package/components/PrismicEmbed.svelte +0 -10
- package/components/PrismicImage.svelte +0 -15
- package/components/PrismicPreview.svelte +0 -26
- package/components/PrismicRichText.svelte +0 -8
- package/components/PrismicText.svelte +0 -7
- package/components/SliceZone.svelte +0 -17
- package/components/index.js +0 -7
- package/configurePrismic.js +0 -17
- package/index.js +0 -13
- package/injectionSymbols.js +0 -1
- package/lib/PrismicProvider.svelte.d.ts +0 -24
- package/lib/components/PrismicImage.svelte.d.ts +0 -18
- package/lib/components/PrismicPreview.svelte.d.ts +0 -20
- package/lib/components/PrismicRichText.svelte.d.ts +0 -20
- package/lib/components/SliceZone.svelte.d.ts +0 -25
- package/lib/components/index.d.ts +0 -2
- package/lib/configurePrismic.d.ts +0 -9
- package/lib/index.d.ts +0 -1
- package/lib/injectionSymbols.d.ts +0 -1
- package/lib/usePrismic.d.ts +0 -2
- package/src/lib/PrismicProvider.svelte +0 -26
- package/src/lib/components/PrismicEmbed.svelte +0 -14
- package/src/lib/components/PrismicImage.svelte +0 -20
- package/src/lib/components/PrismicPreview.svelte +0 -29
- package/src/lib/components/PrismicRichText.svelte +0 -14
- package/src/lib/components/PrismicText.svelte +0 -12
- package/src/lib/components/index.ts +0 -13
- package/src/lib/configurePrismic.ts +0 -30
- package/src/lib/index.ts +0 -18
- package/src/lib/injectionSymbols.ts +0 -1
- package/src/lib/usePrismic.ts +0 -12
- package/src/routes/+page.svelte +0 -35
- package/src/routes/slices/RichText/index.svelte +0 -8
- package/src/types/PrismicConfig.type.ts +0 -8
- package/src/types/PrismicContext.type.ts +0 -13
- package/types/PrismicContext.type.d.ts +0 -7
- package/usePrismic.js +0 -10
- /package/{components → dist/components}/PrismicLink.svelte +0 -0
- /package/{lib → dist}/components/PrismicLink.svelte.d.ts +0 -0
- /package/{components → dist/components}/TodoSliceComponent.svelte +0 -0
- /package/{lib → dist}/components/TodoSliceComponent.svelte.d.ts +0 -0
- /package/{src → dist/src}/app.html +0 -0
- /package/{src → dist/src}/global.d.ts +0 -0
- /package/{src → dist/src}/lib/components/TodoSliceComponent.svelte +0 -0
- /package/{src → dist/src}/routes/slices/CodeSnippet/index.svelte +0 -0
- /package/{src → dist/src}/routes/slices/index.ts +0 -0
- /package/{src → dist/src}/types/CodeSnippetSlice.type.ts +0 -0
- /package/{src → dist/src}/types/PageDocument.type.ts +0 -0
- /package/{src → dist/src}/types/RichTextSlice.type.ts +0 -0
- /package/{src → dist/src}/types/Route.type.ts +0 -0
package/package.json
CHANGED
|
@@ -1,78 +1,145 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
2
|
+
"name": "@prismicio/svelte",
|
|
3
|
+
"version": "0.0.8-dev.0",
|
|
4
|
+
"description": "Svelte plugin, components, and composables to fetch and present Prismic content",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"typescript",
|
|
7
|
+
"prismic",
|
|
8
|
+
"svelte"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "ssh://git@github.com/prismicio/prismic-svelte.git"
|
|
13
|
+
},
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"author": "Prismic <contact@prismic.io> (https://prismic.io)",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
"./package.json": "./package.json",
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"svelte": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"main": "index.js",
|
|
25
|
+
"module": "index.js",
|
|
26
|
+
"types": "index.d.ts",
|
|
27
|
+
"svelte": "./dist/index.js",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "svelte-package -o dist package && shx cp -r src dist/src",
|
|
30
|
+
"dev": "vite dev",
|
|
31
|
+
"format": "prettier --write .",
|
|
32
|
+
"prepare": "npm run build",
|
|
33
|
+
"release": "npm run build && npm run test && standard-version && git push --follow-tags && npm run build && npm publish",
|
|
34
|
+
"release:dry": "standard-version --dry-run",
|
|
35
|
+
"release:alpha": "npm run build && npm run test && standard-version --release-as major --prerelease alpha && git push --follow-tags && npm run build && npm publish --tag alpha",
|
|
36
|
+
"release:alpha:dry": "standard-version --release-as major --prerelease alpha --dry-run",
|
|
37
|
+
"release:dev": "npm run build && npm run test && standard-version --prerelease dev && git push --follow-tags && npm run build && npm publish --tag dev",
|
|
38
|
+
"release:dev:dry": "standard-version --prerelease dev --dry-run",
|
|
39
|
+
"lint": "eslint --ext .js,.ts .",
|
|
40
|
+
"unit": "vitest run --coverage",
|
|
41
|
+
"unit:watch": "vitest watch",
|
|
42
|
+
"test": "npm run lint && npm run unit",
|
|
43
|
+
"preview": "svelte-kit preview",
|
|
44
|
+
"package": "svelte-package -o dist package",
|
|
45
|
+
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
46
|
+
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@prismicio/client": "^6.7.3",
|
|
50
|
+
"@prismicio/helpers": "^2.3.9",
|
|
51
|
+
"@prismicio/richtext": "^2.2.0-alpha.0",
|
|
52
|
+
"@sveltejs/kit": "^1.8.3",
|
|
53
|
+
"svelte": "^3.55.1"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@prismicio/mock": "^0.2.0",
|
|
57
|
+
"@prismicio/types": "^0.2.7",
|
|
58
|
+
"@rollup/plugin-inject": "^5.0.3",
|
|
59
|
+
"@sveltejs/package": "^2.0.0",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^5.53.0",
|
|
61
|
+
"@typescript-eslint/parser": "^5.53.0",
|
|
62
|
+
"@vitest/coverage-c8": "^0.28.5",
|
|
63
|
+
"c8": "^7.13.0",
|
|
64
|
+
"eslint": "^8.15.0",
|
|
65
|
+
"eslint-config-prettier": "^8.5.0",
|
|
66
|
+
"eslint-plugin-prettier": "^4.2.0",
|
|
67
|
+
"eslint-plugin-svelte3": "^4.0.0",
|
|
68
|
+
"eslint-plugin-tsdoc": "^0.2.16",
|
|
69
|
+
"prettier": "^2.8.4",
|
|
70
|
+
"prettier-plugin-jsdoc": "^0.3.38",
|
|
71
|
+
"prettier-plugin-svelte": "^2.9.0",
|
|
72
|
+
"shx": "^0.3.4",
|
|
73
|
+
"standard-version": "^9.3.2",
|
|
74
|
+
"svelte-check": "^3.0.3",
|
|
75
|
+
"svelte-preprocess": "^5.0.1",
|
|
76
|
+
"svelte2tsx": "^0.6.1",
|
|
77
|
+
"tslib": "^2.5.0",
|
|
78
|
+
"typescript": "^4.9.5",
|
|
79
|
+
"vitest": "^0.28.5"
|
|
80
|
+
},
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": ">=12.7.0"
|
|
83
|
+
},
|
|
84
|
+
"publishConfig": {
|
|
85
|
+
"access": "public"
|
|
86
|
+
},
|
|
87
|
+
"optionalDependencies": {
|
|
88
|
+
"@esbuild/android-arm": "^0.17.10"
|
|
89
|
+
},
|
|
90
|
+
"files": [
|
|
91
|
+
"dist"
|
|
92
|
+
],
|
|
93
|
+
"typesVersions": {
|
|
94
|
+
">4.0": {
|
|
95
|
+
"PrismicProvider.svelte": [
|
|
96
|
+
"./dist/PrismicProvider.svelte.d.ts"
|
|
97
|
+
],
|
|
98
|
+
"components/PrismicEmbed.svelte": [
|
|
99
|
+
"./dist/components/PrismicEmbed.svelte.d.ts"
|
|
100
|
+
],
|
|
101
|
+
"components/PrismicImage.svelte": [
|
|
102
|
+
"./dist/components/PrismicImage.svelte.d.ts"
|
|
103
|
+
],
|
|
104
|
+
"components/PrismicLink.svelte": [
|
|
105
|
+
"./dist/components/PrismicLink.svelte.d.ts"
|
|
106
|
+
],
|
|
107
|
+
"components/PrismicPreview.svelte": [
|
|
108
|
+
"./dist/components/PrismicPreview.svelte.d.ts"
|
|
109
|
+
],
|
|
110
|
+
"components/PrismicRichText/DefaultComponent.svelte": [
|
|
111
|
+
"./dist/components/PrismicRichText/DefaultComponent.svelte.d.ts"
|
|
112
|
+
],
|
|
113
|
+
"components/PrismicRichText/PrismicRichText.svelte": [
|
|
114
|
+
"./dist/components/PrismicRichText/PrismicRichText.svelte.d.ts"
|
|
115
|
+
],
|
|
116
|
+
"components/PrismicRichText/Serialize.svelte": [
|
|
117
|
+
"./dist/components/PrismicRichText/Serialize.svelte.d.ts"
|
|
118
|
+
],
|
|
119
|
+
"components/PrismicText.svelte": [
|
|
120
|
+
"./dist/components/PrismicText.svelte.d.ts"
|
|
121
|
+
],
|
|
122
|
+
"components/SliceZone.svelte": [
|
|
123
|
+
"./dist/components/SliceZone.svelte.d.ts"
|
|
124
|
+
],
|
|
125
|
+
"components/TodoSliceComponent.svelte": [
|
|
126
|
+
"./dist/components/TodoSliceComponent.svelte.d.ts"
|
|
127
|
+
],
|
|
128
|
+
"components": [
|
|
129
|
+
"./dist/components/index.d.ts"
|
|
130
|
+
],
|
|
131
|
+
"configurePrismic": [
|
|
132
|
+
"./dist/configurePrismic.d.ts"
|
|
133
|
+
],
|
|
134
|
+
"index": [
|
|
135
|
+
"./dist/index.d.ts"
|
|
136
|
+
],
|
|
137
|
+
"injectionSymbols": [
|
|
138
|
+
"./dist/injectionSymbols.d.ts"
|
|
139
|
+
],
|
|
140
|
+
"usePrismic": [
|
|
141
|
+
"./dist/usePrismic.d.ts"
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
-
|
|
5
|
-
### [0.0.6](https://github.com/prismicio/prismic-svelte/compare/v0.0.5...v0.0.6) (2023-02-24)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### Features
|
|
9
|
-
|
|
10
|
-
* add `<PrismicLink>` component ([1db9dc0](https://github.com/prismicio/prismic-svelte/commit/1db9dc0cd6a24de87505b5e1486fe9458cb7be01))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Chore
|
|
14
|
-
|
|
15
|
-
* fix slice typing ([16340b3](https://github.com/prismicio/prismic-svelte/commit/16340b320396f69127e89d26dae498baff8fa299))
|
|
16
|
-
|
|
17
|
-
### [0.0.5](https://github.com/prismicio/prismic-svelte/compare/v0.0.4...v0.0.5) (2023-02-23)
|
|
18
|
-
|
|
19
|
-
### Chore
|
|
20
|
-
|
|
21
|
-
- upgrade SvelteKit to 1.0 ([#3](https://github.com/prismicio/prismic-svelte/issues/3)) ([8d5addc](https://github.com/prismicio/prismic-svelte/commit/8d5addcdd669895ccacb666286b57af7825f4869))
|
|
22
|
-
|
|
23
|
-
### [0.0.4](https://github.com/prismicio/prismic-svelte/compare/v0.0.3...v0.0.4) (2022-05-27)
|
|
24
|
-
|
|
25
|
-
### Chore
|
|
26
|
-
|
|
27
|
-
- Update docs link ([e8d14cf](https://github.com/prismicio/prismic-svelte/commit/e8d14cf66ee9c52d624848dbcabe29a531ecae5e))
|
|
28
|
-
|
|
29
|
-
### [0.0.3](https://github.com/prismicio/prismic-svelte/compare/v0.0.2...v0.0.3) (2022-05-17)
|
|
30
|
-
|
|
31
|
-
### Bug Fixes
|
|
32
|
-
|
|
33
|
-
- change dev default value to ([11903bc](https://github.com/prismicio/prismic-svelte/commit/11903bc0e11f86e57bdebee3888c8b7efcffac97))
|
|
34
|
-
|
|
35
|
-
### Documentation
|
|
36
|
-
|
|
37
|
-
- add experimental disclaimer ([3779ec1](https://github.com/prismicio/prismic-svelte/commit/3779ec199cbcbf5d04bacbf2274cf484c1eec0db))
|
|
38
|
-
|
|
39
|
-
### Chore
|
|
40
|
-
|
|
41
|
-
- **deps:** maintain lock file ([d7ab62f](https://github.com/prismicio/prismic-svelte/commit/d7ab62f28884c2734ef2ae96b6a2f094ef835211))
|
|
42
|
-
|
|
43
|
-
### [0.0.2](https://github.com/prismicio/prismic-svelte/compare/v0.0.1...v0.0.2) (2022-05-13)
|
|
44
|
-
|
|
45
|
-
### Chore
|
|
46
|
-
|
|
47
|
-
- fix release script ([074d4fb](https://github.com/prismicio/prismic-svelte/commit/074d4fbdd6e3a7fd49b2e7fbe6b8a6b7b315491f))
|
|
48
|
-
- fix release script ([026072a](https://github.com/prismicio/prismic-svelte/commit/026072ac3ff6fe08e161ac15c8776767af70f0d3))
|
|
49
|
-
|
|
50
|
-
### 0.0.1 (2022-05-13)
|
|
51
|
-
|
|
52
|
-
### Features
|
|
53
|
-
|
|
54
|
-
- Change PrismicProvider prop to only Command line to bootstrap prismic projects. ([e4675d4](https://github.com/prismicio/prismic-svelte/commit/e4675d48d4a2d9fe89c04aa4273948ef2a84d018))
|
|
55
|
-
- Finish creating components; Create Slices for route. ([5b18487](https://github.com/prismicio/prismic-svelte/commit/5b1848736dcf5d75e09556a57756017fc46847f4))
|
|
56
|
-
- Get htmlSerializer from context in PrismicRichText ([36664bc](https://github.com/prismicio/prismic-svelte/commit/36664bc72d7e9eb6cd353c96ae22ed209143a905))
|
|
57
|
-
- Handle missing url ([54b3a75](https://github.com/prismicio/prismic-svelte/commit/54b3a7529eda7b29542483a5b7b0ab33c2b22643))
|
|
58
|
-
- Improve mock data ([782a0f0](https://github.com/prismicio/prismic-svelte/commit/782a0f031c41aeefb2d14220146087fc164b6eae))
|
|
59
|
-
- Merge Lucie's and Sam's link components ([3ea6c7f](https://github.com/prismicio/prismic-svelte/commit/3ea6c7fdb48ad718a62f0cf70662fdb79e6e7d96))
|
|
60
|
-
- Rename to ([cc271cb](https://github.com/prismicio/prismic-svelte/commit/cc271cb285089f3bc6104b771711fe62fb3f5fea))
|
|
61
|
-
- revamp slicezone component ([65c55b8](https://github.com/prismicio/prismic-svelte/commit/65c55b84f7c7eea7e65470f6b5a101c7749d2cde))
|
|
62
|
-
- setup link component ([0545d48](https://github.com/prismicio/prismic-svelte/commit/0545d48fcb0413f40e917d1f4857996d5f402e69))
|
|
63
|
-
- setup prismic provider ([9b9752f](https://github.com/prismicio/prismic-svelte/commit/9b9752fce5f4754bc195e83f44a4bb081e203b95))
|
|
64
|
-
- Setup Prismicimage component ([0033cb5](https://github.com/prismicio/prismic-svelte/commit/0033cb515f2444a5f45040d28a27bf05ac7e0dd0))
|
|
65
|
-
|
|
66
|
-
### Bug Fixes
|
|
67
|
-
|
|
68
|
-
- Add shx so commands work cross platform ([1731f64](https://github.com/prismicio/prismic-svelte/commit/1731f64fa9310fdb93cf15b250320e0939d73f8b))
|
|
69
|
-
|
|
70
|
-
### Chore
|
|
71
|
-
|
|
72
|
-
- Add TODOs, rename plaintext component ([691aab7](https://github.com/prismicio/prismic-svelte/commit/691aab7bc9d47d2bdb47024e30ca90301813c85d))
|
|
73
|
-
- init project ([9afa15a](https://github.com/prismicio/prismic-svelte/commit/9afa15a8a4372de8eb5b16e087433d2a640a93a0))
|
|
74
|
-
- maintain repository ([e3ae492](https://github.com/prismicio/prismic-svelte/commit/e3ae492c0c03e121c8bddf03c96065485a448863))
|
|
75
|
-
- migrate to vitest ([bbae453](https://github.com/prismicio/prismic-svelte/commit/bbae45309262b845dde7149ffad938bcc8aabc66))
|
|
76
|
-
- setup todo components ([d57cf26](https://github.com/prismicio/prismic-svelte/commit/d57cf263f5294d9227a43bb9bb82e9e788dca09e))
|
|
77
|
-
- update template config ([93a1b59](https://github.com/prismicio/prismic-svelte/commit/93a1b5971cf796f6eb9433044defc67eccf56bd2))
|
package/PrismicProvider.svelte
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script>import { setContext } from "svelte";
|
|
2
|
-
import { prismicKey } from "./injectionSymbols";
|
|
3
|
-
// export let client: PrismicContext["client"] = undefined;
|
|
4
|
-
// export let linkResolver: PrismicContext["linkResolver"] = undefined;
|
|
5
|
-
// export let htmlSerializer: PrismicContext["htmlSerializer"] = undefined;
|
|
6
|
-
export let prismic = {
|
|
7
|
-
client: undefined,
|
|
8
|
-
linkResolver: undefined,
|
|
9
|
-
prismic: undefined,
|
|
10
|
-
htmlSerializer: undefined,
|
|
11
|
-
slices: undefined,
|
|
12
|
-
};
|
|
13
|
-
setContext(prismicKey, {
|
|
14
|
-
client: prismic.client,
|
|
15
|
-
linkResolver: prismic.linkResolver,
|
|
16
|
-
htmlSerializer: prismic.htmlSerializer,
|
|
17
|
-
slices: prismic.slices,
|
|
18
|
-
});
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<slot />
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<script>import * as prismicH from "@prismicio/helpers";
|
|
2
|
-
export let field;
|
|
3
|
-
let className;
|
|
4
|
-
export { className as class };
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
{#if prismicH.isFilled.image(field)}
|
|
8
|
-
{@const { alt, dimensions } = field}
|
|
9
|
-
{@const { width, height } = dimensions}
|
|
10
|
-
{@const { src, srcset } = prismicH.asImageWidthSrcSet(field)}
|
|
11
|
-
|
|
12
|
-
<img {src} {srcset} {alt} {width} {height} class={className} />
|
|
13
|
-
{:else}
|
|
14
|
-
<img alt={field.alt || ""} class={className} />
|
|
15
|
-
{/if}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script>import * as prismic from "@prismicio/client";
|
|
2
|
-
import { goto } from "$app/navigation";
|
|
3
|
-
import { onMount } from "svelte";
|
|
4
|
-
export let linkResolver;
|
|
5
|
-
export let defaultURL;
|
|
6
|
-
export let client;
|
|
7
|
-
onMount(async () => {
|
|
8
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
9
|
-
const previewToken = urlParams.get("token");
|
|
10
|
-
const documentID = urlParams.get("documentId");
|
|
11
|
-
if (documentID && previewToken) {
|
|
12
|
-
const redirect = await client.resolvePreviewURL({
|
|
13
|
-
documentID,
|
|
14
|
-
defaultURL,
|
|
15
|
-
previewToken,
|
|
16
|
-
linkResolver,
|
|
17
|
-
});
|
|
18
|
-
await goto(redirect);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
console.log("Could not resolve preview URL.");
|
|
22
|
-
// TODO: Handle else
|
|
23
|
-
});
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<slot />
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<script>import * as prismicH from "@prismicio/helpers";
|
|
2
|
-
import { usePrismic } from "./..";
|
|
3
|
-
let { htmlSerializer, linkResolver } = usePrismic();
|
|
4
|
-
export let field;
|
|
5
|
-
export { htmlSerializer, linkResolver };
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
{@html prismicH.asHTML(field, linkResolver, htmlSerializer)}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script>import TodoSliceComponent from "./TodoSliceComponent.svelte";
|
|
2
|
-
export let slices = [];
|
|
3
|
-
export let components = {};
|
|
4
|
-
export let context = {};
|
|
5
|
-
export let defaultComponent = undefined;
|
|
6
|
-
export let dev = false;
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
{#each slices as slice, index}
|
|
10
|
-
{@const type = "slice_type" in slice ? slice.slice_type : slice.type}
|
|
11
|
-
{@const Component = components[type] || defaultComponent}
|
|
12
|
-
{#if Component}
|
|
13
|
-
<svelte:component this={Component} {slice} {slices} {context} {index} />
|
|
14
|
-
{:else}
|
|
15
|
-
<TodoSliceComponent {slice} {dev} />
|
|
16
|
-
{/if}
|
|
17
|
-
{/each}
|
package/components/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// export { default as PrismicEmbed } from "./PrismicEmbed.svelte";
|
|
2
|
-
// export { default as PrismicImage } from "./PrismicImage.svelte";
|
|
3
|
-
export { default as PrismicLink } from "./PrismicLink.svelte";
|
|
4
|
-
// export { default as PrismicText } from "./PrismicText.svelte";
|
|
5
|
-
// export { default as PrismicRichText } from "./PrismicRichText.svelte";
|
|
6
|
-
// export { default as PrismicPreview } from "./PrismicPreview.svelte";
|
|
7
|
-
export { default as SliceZone } from "./SliceZone.svelte";
|
package/configurePrismic.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as prismic from "@prismicio/client";
|
|
2
|
-
import * as prismicH from "@prismicio/helpers";
|
|
3
|
-
const configurePrismic = (globalOptions) => {
|
|
4
|
-
const { repositoryName, htmlSerializer, linkResolver, slices } = globalOptions;
|
|
5
|
-
const endpoint = prismic.getEndpoint(repositoryName);
|
|
6
|
-
const client = prismic.createClient(endpoint, globalOptions);
|
|
7
|
-
const clientWithFetch = () => prismic.createClient(endpoint, { ...globalOptions, fetch });
|
|
8
|
-
return {
|
|
9
|
-
...prismicH,
|
|
10
|
-
client,
|
|
11
|
-
clientWithFetch,
|
|
12
|
-
htmlSerializer,
|
|
13
|
-
linkResolver,
|
|
14
|
-
slices,
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export default configurePrismic;
|
package/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// export { default as configurePrismic } from "./configurePrismic";
|
|
2
|
-
export {
|
|
3
|
-
// Components
|
|
4
|
-
// PrismicEmbed,
|
|
5
|
-
// PrismicImage,
|
|
6
|
-
PrismicLink,
|
|
7
|
-
// PrismicText,
|
|
8
|
-
// PrismicRichText,
|
|
9
|
-
// Slice Zone
|
|
10
|
-
SliceZone, } from "./components";
|
|
11
|
-
// export { default as PrismicProvider } from "./PrismicProvider.svelte";
|
|
12
|
-
// export { usePrismic } from "./usePrismic";
|
|
13
|
-
// export type { PrismicContext } from "./types";
|
package/injectionSymbols.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const prismicKey = Symbol("prismic");
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
prismic?: {
|
|
5
|
-
client: undefined;
|
|
6
|
-
linkResolver: undefined;
|
|
7
|
-
prismic: undefined;
|
|
8
|
-
htmlSerializer: undefined;
|
|
9
|
-
slices: undefined;
|
|
10
|
-
} | undefined;
|
|
11
|
-
};
|
|
12
|
-
events: {
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
};
|
|
15
|
-
slots: {
|
|
16
|
-
default: {};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type PrismicProviderProps = typeof __propDef.props;
|
|
20
|
-
export type PrismicProviderEvents = typeof __propDef.events;
|
|
21
|
-
export type PrismicProviderSlots = typeof __propDef.slots;
|
|
22
|
-
export default class PrismicProvider extends SvelteComponentTyped<PrismicProviderProps, PrismicProviderEvents, PrismicProviderSlots> {
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type * as prismicT from "@prismicio/types";
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
field: prismicT.ImageField;
|
|
6
|
-
class: string;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
};
|
|
13
|
-
export type PrismicImageProps = typeof __propDef.props;
|
|
14
|
-
export type PrismicImageEvents = typeof __propDef.events;
|
|
15
|
-
export type PrismicImageSlots = typeof __propDef.slots;
|
|
16
|
-
export default class PrismicImage extends SvelteComponentTyped<PrismicImageProps, PrismicImageEvents, PrismicImageSlots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
linkResolver: any;
|
|
5
|
-
defaultURL: string;
|
|
6
|
-
client: any;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {
|
|
12
|
-
default: {};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export type PrismicPreviewProps = typeof __propDef.props;
|
|
16
|
-
export type PrismicPreviewEvents = typeof __propDef.events;
|
|
17
|
-
export type PrismicPreviewSlots = typeof __propDef.slots;
|
|
18
|
-
export default class PrismicPreview extends SvelteComponentTyped<PrismicPreviewProps, PrismicPreviewEvents, PrismicPreviewSlots> {
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { RichTextField as RichTextFieldType } from "@prismicio/types";
|
|
3
|
-
import type { TitleField as TitleFieldType } from "@prismicio/types";
|
|
4
|
-
declare const __propDef: {
|
|
5
|
-
props: {
|
|
6
|
-
field: TitleFieldType | RichTextFieldType;
|
|
7
|
-
htmlSerializer?: any;
|
|
8
|
-
linkResolver?: any;
|
|
9
|
-
};
|
|
10
|
-
events: {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {};
|
|
14
|
-
};
|
|
15
|
-
export type PrismicRichTextProps = typeof __propDef.props;
|
|
16
|
-
export type PrismicRichTextEvents = typeof __propDef.events;
|
|
17
|
-
export type PrismicRichTextSlots = typeof __propDef.slots;
|
|
18
|
-
export default class PrismicRichText extends SvelteComponentTyped<PrismicRichTextProps, PrismicRichTextEvents, PrismicRichTextSlots> {
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { SvelteComponent } from "svelte";
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
slices?: ({
|
|
6
|
-
slice_type: string;
|
|
7
|
-
} | {
|
|
8
|
-
type: string;
|
|
9
|
-
})[] | undefined;
|
|
10
|
-
components?: Record<string, SvelteComponent | (new (...args: any[]) => SvelteComponent)> | undefined;
|
|
11
|
-
context?: any;
|
|
12
|
-
defaultComponent?: SvelteComponent | (new (...args: any[]) => SvelteComponent) | undefined;
|
|
13
|
-
dev?: boolean | undefined;
|
|
14
|
-
};
|
|
15
|
-
events: {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {};
|
|
19
|
-
};
|
|
20
|
-
export type SliceZoneProps = typeof __propDef.props;
|
|
21
|
-
export type SliceZoneEvents = typeof __propDef.events;
|
|
22
|
-
export type SliceZoneSlots = typeof __propDef.slots;
|
|
23
|
-
export default class SliceZone extends SvelteComponentTyped<SliceZoneProps, SliceZoneEvents, SliceZoneSlots> {
|
|
24
|
-
}
|
|
25
|
-
export {};
|
package/lib/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { PrismicLink, SliceZone, } from "./components";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const prismicKey: unique symbol;
|
package/lib/usePrismic.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { setContext } from "svelte";
|
|
3
|
-
|
|
4
|
-
import { prismicKey } from "./injectionSymbols";
|
|
5
|
-
import type { PrismicContext } from "../types/PrismicContext.type";
|
|
6
|
-
|
|
7
|
-
// export let client: PrismicContext["client"] = undefined;
|
|
8
|
-
// export let linkResolver: PrismicContext["linkResolver"] = undefined;
|
|
9
|
-
// export let htmlSerializer: PrismicContext["htmlSerializer"] = undefined;
|
|
10
|
-
export let prismic = {
|
|
11
|
-
client: undefined,
|
|
12
|
-
linkResolver: undefined,
|
|
13
|
-
prismic: undefined,
|
|
14
|
-
htmlSerializer: undefined,
|
|
15
|
-
slices: undefined,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
setContext<PrismicContext>(prismicKey, {
|
|
19
|
-
client: prismic.client,
|
|
20
|
-
linkResolver: prismic.linkResolver,
|
|
21
|
-
htmlSerializer: prismic.htmlSerializer,
|
|
22
|
-
slices: prismic.slices,
|
|
23
|
-
});
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<slot />
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import * as prismicH from "@prismicio/helpers";
|
|
3
|
-
import type * as prismicT from "@prismicio/types";
|
|
4
|
-
|
|
5
|
-
export let field: prismicT.EmbedField;
|
|
6
|
-
|
|
7
|
-
if (!prismicH.isFilled.embed(field)) {
|
|
8
|
-
console.warn("Invalid prop");
|
|
9
|
-
}
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
{#if prismicH.isFilled.embed(field)}
|
|
13
|
-
{@html field.html}
|
|
14
|
-
{/if}
|