@pagebridge/sanity 0.0.2 → 0.1.1
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/LICENSE +21 -21
- package/README.md +228 -214
- package/dist/components/RefreshQueueTool.js +10 -10
- package/dist/components/SearchPerformancePane.js +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +2 -2
- package/package.json +20 -1
- package/.turbo/turbo-build.log +0 -2
- package/dist/components/DecayAlertCard.d.ts +0 -16
- package/dist/components/DecayAlertCard.d.ts.map +0 -1
- package/dist/components/DecayAlertCard.js +0 -24
- package/dist/components/DecayBadge.d.ts +0 -3
- package/dist/components/DecayBadge.d.ts.map +0 -1
- package/dist/components/DecayBadge.js +0 -19
- package/dist/components/PerformanceChart.d.ts +0 -12
- package/dist/components/PerformanceChart.d.ts.map +0 -1
- package/dist/components/PerformanceChart.js +0 -18
- package/dist/components/PerformanceInspector.d.ts +0 -3
- package/dist/components/PerformanceInspector.d.ts.map +0 -1
- package/dist/components/PerformanceInspector.js +0 -174
- package/dist/schemas/gscKeywordTarget.d.ts +0 -22
- package/dist/schemas/gscKeywordTarget.d.ts.map +0 -1
- package/dist/schemas/gscKeywordTarget.js +0 -43
- package/eslint.config.js +0 -3
- package/src/components/RefreshQueueTool.tsx +0 -196
- package/src/components/SearchPerformancePane.tsx +0 -237
- package/src/index.ts +0 -18
- package/src/plugin.ts +0 -120
- package/src/schemas/gscRefreshTask.ts +0 -203
- package/src/schemas/gscSite.ts +0 -71
- package/src/schemas/gscSnapshot.ts +0 -131
- package/src/schemas/index.ts +0 -11
- package/tsconfig.json +0 -23
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Soma Somorjai
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Soma Somorjai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,214 +1,228 @@
|
|
|
1
|
-
# @pagebridge/sanity
|
|
2
|
-
|
|
3
|
-
Sanity Studio v3 plugin for PageBridge. Provides document schemas, UI components, and tools for viewing search performance data and managing content refresh tasks.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm add @pagebridge/sanity
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Setup
|
|
12
|
-
|
|
13
|
-
### 1. Add the Plugin
|
|
14
|
-
|
|
15
|
-
In your `sanity.config.ts`:
|
|
16
|
-
|
|
17
|
-
```typescript
|
|
18
|
-
import { defineConfig } from
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
export default defineConfig({
|
|
22
|
-
// ... other config
|
|
23
|
-
plugins: [
|
|
24
|
-
|
|
25
|
-
contentTypes: [
|
|
26
|
-
}),
|
|
27
|
-
],
|
|
28
|
-
});
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### 2. Add the Structure Resolver
|
|
32
|
-
|
|
33
|
-
To display the Performance pane on your content documents:
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
import { defineConfig } from
|
|
37
|
-
import { structureTool } from
|
|
38
|
-
import {
|
|
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
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// Create
|
|
174
|
-
const
|
|
175
|
-
contentTypes: [
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
1
|
+
# @pagebridge/sanity
|
|
2
|
+
|
|
3
|
+
Sanity Studio v3 plugin for PageBridge. Provides document schemas, UI components, and tools for viewing search performance data and managing content refresh tasks.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @pagebridge/sanity
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
### 1. Add the Plugin
|
|
14
|
+
|
|
15
|
+
In your `sanity.config.ts`:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { defineConfig } from "sanity";
|
|
19
|
+
import { pageBridgePlugin } from "@pagebridge/sanity";
|
|
20
|
+
|
|
21
|
+
export default defineConfig({
|
|
22
|
+
// ... other config
|
|
23
|
+
plugins: [
|
|
24
|
+
pageBridgePlugin({
|
|
25
|
+
contentTypes: ["post", "page"], // Document types to track
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 2. Add the Structure Resolver
|
|
32
|
+
|
|
33
|
+
To display the Performance pane on your content documents:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { defineConfig } from "sanity";
|
|
37
|
+
import { structureTool } from "sanity/structure";
|
|
38
|
+
import {
|
|
39
|
+
pageBridgePlugin,
|
|
40
|
+
createPageBridgeStructureResolver,
|
|
41
|
+
} from "@pagebridge/sanity";
|
|
42
|
+
|
|
43
|
+
export default defineConfig({
|
|
44
|
+
// ... other config
|
|
45
|
+
plugins: [
|
|
46
|
+
structureTool({
|
|
47
|
+
structure: createPageBridgeStructureResolver({
|
|
48
|
+
contentTypes: ["post", "page"],
|
|
49
|
+
}),
|
|
50
|
+
}),
|
|
51
|
+
pageBridgePlugin({
|
|
52
|
+
contentTypes: ["post", "page"],
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Document Schemas
|
|
59
|
+
|
|
60
|
+
The plugin registers three document types:
|
|
61
|
+
|
|
62
|
+
### gscSite
|
|
63
|
+
|
|
64
|
+
Represents a Google Search Console property.
|
|
65
|
+
|
|
66
|
+
| Field | Type | Description |
|
|
67
|
+
| ------------- | -------- | -------------------------------------------- |
|
|
68
|
+
| siteUrl | string | GSC site URL (e.g., `sc-domain:example.com`) |
|
|
69
|
+
| slug | slug | URL-friendly identifier |
|
|
70
|
+
| defaultLocale | string | Default locale (default: "en") |
|
|
71
|
+
| pathPrefix | string | Path prefix for URL matching (e.g., `/blog`) |
|
|
72
|
+
| lastSyncedAt | datetime | Last sync timestamp (read-only) |
|
|
73
|
+
|
|
74
|
+
### gscSnapshot
|
|
75
|
+
|
|
76
|
+
Performance metrics snapshot linked to content documents.
|
|
77
|
+
|
|
78
|
+
| Field | Type | Description |
|
|
79
|
+
| -------------- | --------- | ------------------------------- |
|
|
80
|
+
| site | reference | Reference to gscSite |
|
|
81
|
+
| page | string | Page URL |
|
|
82
|
+
| linkedDocument | reference | Matched content document |
|
|
83
|
+
| period | string | `last7`, `last28`, or `last90` |
|
|
84
|
+
| clicks | number | Total clicks |
|
|
85
|
+
| impressions | number | Total impressions |
|
|
86
|
+
| ctr | number | Click-through rate |
|
|
87
|
+
| position | number | Average position |
|
|
88
|
+
| topQueries | array | Top search queries with metrics |
|
|
89
|
+
| fetchedAt | datetime | When data was fetched |
|
|
90
|
+
| indexStatus | object | Google index status details |
|
|
91
|
+
|
|
92
|
+
### gscRefreshTask
|
|
93
|
+
|
|
94
|
+
Content refresh task with decay signal information.
|
|
95
|
+
|
|
96
|
+
| Field | Type | Description |
|
|
97
|
+
| -------------- | --------- | --------------------------------------------------------- |
|
|
98
|
+
| site | reference | Reference to gscSite |
|
|
99
|
+
| linkedDocument | reference | Content document needing refresh |
|
|
100
|
+
| reason | string | `position_decay`, `low_ctr`, `impressions_drop`, `manual` |
|
|
101
|
+
| severity | string | `low`, `medium`, `high` |
|
|
102
|
+
| status | string | `open`, `snoozed`, `in_progress`, `done`, `dismissed` |
|
|
103
|
+
| snoozedUntil | datetime | When to resurface (if snoozed) |
|
|
104
|
+
| metrics | object | Position, CTR, impressions data |
|
|
105
|
+
| queryContext | array | Top 5 queries with stats |
|
|
106
|
+
| notes | text | Resolution notes |
|
|
107
|
+
| createdAt | datetime | Task creation time |
|
|
108
|
+
| resolvedAt | datetime | Task resolution time |
|
|
109
|
+
|
|
110
|
+
## Components
|
|
111
|
+
|
|
112
|
+
### SearchPerformancePane
|
|
113
|
+
|
|
114
|
+
Document view pane showing performance metrics for a content document.
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
import { SearchPerformancePane } from "@pagebridge/sanity";
|
|
118
|
+
|
|
119
|
+
// Used automatically when you configure the structure resolver
|
|
120
|
+
// Can also be used directly in custom document views
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The pane displays:
|
|
124
|
+
|
|
125
|
+
- Clicks, impressions, CTR, and position metrics
|
|
126
|
+
- Top search queries driving traffic
|
|
127
|
+
- Google index status
|
|
128
|
+
- Link to associated refresh tasks
|
|
129
|
+
|
|
130
|
+
### RefreshQueueTool
|
|
131
|
+
|
|
132
|
+
Sanity tool for managing content refresh tasks. Accessible from the Studio sidebar.
|
|
133
|
+
|
|
134
|
+
Features:
|
|
135
|
+
|
|
136
|
+
- Filter tasks by status (open, in progress, snoozed, done, dismissed)
|
|
137
|
+
- Sort by severity or creation date
|
|
138
|
+
- View decay signal details
|
|
139
|
+
- Update task status
|
|
140
|
+
- Add resolution notes
|
|
141
|
+
|
|
142
|
+
## Configuration Options
|
|
143
|
+
|
|
144
|
+
### pageBridgePlugin
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
interface PageBridgePluginConfig {
|
|
148
|
+
// Document types that can be linked to snapshots and tasks
|
|
149
|
+
contentTypes: string[];
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### createPageBridgeStructureResolver
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
interface StructureResolverConfig {
|
|
157
|
+
// Document types to show the Performance pane on
|
|
158
|
+
contentTypes: string[];
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Using Schemas Directly
|
|
163
|
+
|
|
164
|
+
If you need to customize the schemas or use them without the plugin:
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import {
|
|
168
|
+
gscSite,
|
|
169
|
+
createGscSnapshot,
|
|
170
|
+
createGscRefreshTask,
|
|
171
|
+
} from "@pagebridge/sanity/schemas";
|
|
172
|
+
|
|
173
|
+
// Create snapshot schema with custom content types
|
|
174
|
+
const customSnapshot = createGscSnapshot({
|
|
175
|
+
contentTypes: ["article", "guide"],
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// Create task schema with custom content types
|
|
179
|
+
const customTask = createGscRefreshTask({
|
|
180
|
+
contentTypes: ["article", "guide"],
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Styling
|
|
185
|
+
|
|
186
|
+
The components use Sanity UI and follow the Studio's theme. No additional CSS is required.
|
|
187
|
+
|
|
188
|
+
## Peer Dependencies
|
|
189
|
+
|
|
190
|
+
- `sanity` >= 3.0.0
|
|
191
|
+
- `react` >= 18.0.0
|
|
192
|
+
- `react-dom` >= 18.0.0
|
|
193
|
+
- `@sanity/ui` >= 2.0.0
|
|
194
|
+
- `@sanity/icons` >= 3.0.0
|
|
195
|
+
|
|
196
|
+
## Exports
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
// Plugin
|
|
200
|
+
export {
|
|
201
|
+
pageBridgePlugin,
|
|
202
|
+
createPageBridgeStructureResolver,
|
|
203
|
+
} from "@pagebridge/sanity";
|
|
204
|
+
export type { PageBridgePluginConfig } from "@pagebridge/sanity";
|
|
205
|
+
|
|
206
|
+
// Components
|
|
207
|
+
export {
|
|
208
|
+
SearchPerformancePane,
|
|
209
|
+
RefreshQueueTool,
|
|
210
|
+
} from "@pagebridge/sanity";
|
|
211
|
+
|
|
212
|
+
// Schemas
|
|
213
|
+
export {
|
|
214
|
+
gscSite,
|
|
215
|
+
gscSnapshot,
|
|
216
|
+
gscRefreshTask,
|
|
217
|
+
createGscSnapshot,
|
|
218
|
+
createGscRefreshTask,
|
|
219
|
+
} from "@pagebridge/sanity/schemas";
|
|
220
|
+
export type {
|
|
221
|
+
GscSnapshotOptions,
|
|
222
|
+
GscRefreshTaskOptions,
|
|
223
|
+
} from "@pagebridge/sanity/schemas";
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## License
|
|
227
|
+
|
|
228
|
+
MIT
|
|
@@ -22,16 +22,16 @@ export function RefreshQueueTool() {
|
|
|
22
22
|
const query = filter === "all"
|
|
23
23
|
? `*[_type == "gscRefreshTask" && status != "done" && status != "dismissed"]`
|
|
24
24
|
: `*[_type == "gscRefreshTask" && status == $status]`;
|
|
25
|
-
const results = await client.fetch(`${query} | order(severity desc, createdAt desc) {
|
|
26
|
-
_id,
|
|
27
|
-
reason,
|
|
28
|
-
severity,
|
|
29
|
-
status,
|
|
30
|
-
snoozedUntil,
|
|
31
|
-
metrics,
|
|
32
|
-
"documentTitle": linkedDocument->title,
|
|
33
|
-
"documentSlug": linkedDocument->slug.current,
|
|
34
|
-
createdAt
|
|
25
|
+
const results = await client.fetch(`${query} | order(severity desc, createdAt desc) {
|
|
26
|
+
_id,
|
|
27
|
+
reason,
|
|
28
|
+
severity,
|
|
29
|
+
status,
|
|
30
|
+
snoozedUntil,
|
|
31
|
+
metrics,
|
|
32
|
+
"documentTitle": linkedDocument->title,
|
|
33
|
+
"documentSlug": linkedDocument->slug.current,
|
|
34
|
+
createdAt
|
|
35
35
|
}`, { status: filter });
|
|
36
36
|
setTasks(results);
|
|
37
37
|
}, [filter, client]);
|
|
@@ -9,17 +9,17 @@ export function SearchPerformancePane({ documentId, }) {
|
|
|
9
9
|
const [loading, setLoading] = useState(true);
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
async function fetchData() {
|
|
12
|
-
const snapshot = await client.fetch(`*[_type == "gscSnapshot" && linkedDocument._ref == $id && period == "last28"][0]{
|
|
13
|
-
clicks,
|
|
14
|
-
impressions,
|
|
15
|
-
ctr,
|
|
16
|
-
position,
|
|
17
|
-
topQueries,
|
|
18
|
-
fetchedAt,
|
|
19
|
-
indexStatus
|
|
12
|
+
const snapshot = await client.fetch(`*[_type == "gscSnapshot" && linkedDocument._ref == $id && period == "last28"][0]{
|
|
13
|
+
clicks,
|
|
14
|
+
impressions,
|
|
15
|
+
ctr,
|
|
16
|
+
position,
|
|
17
|
+
topQueries,
|
|
18
|
+
fetchedAt,
|
|
19
|
+
indexStatus
|
|
20
20
|
}`, { id: documentId });
|
|
21
|
-
const previousSnapshot = await client.fetch(`*[_type == "gscSnapshot" && linkedDocument._ref == $id && period == "last28"] | order(fetchedAt desc)[1]{
|
|
22
|
-
position
|
|
21
|
+
const previousSnapshot = await client.fetch(`*[_type == "gscSnapshot" && linkedDocument._ref == $id && period == "last28"] | order(fetchedAt desc)[1]{
|
|
22
|
+
position
|
|
23
23
|
}`, { id: documentId });
|
|
24
24
|
if (snapshot) {
|
|
25
25
|
setData({
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { pageBridgePlugin, createPageBridgeStructureResolver, createPageBridgeStructure, PAGEBRIDGE_TYPES, type PageBridgePluginConfig, } from "./plugin";
|
|
2
2
|
export { gscSite, gscSnapshot, gscRefreshTask, createGscSnapshot, createGscRefreshTask, type GscSnapshotOptions, type GscRefreshTaskOptions, } from "./schemas";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,iCAAiC,EACjC,yBAAyB,EACzB,gBAAgB,EAChB,KAAK,sBAAsB,GAC5B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Note: React components are not exported here to avoid loading them during schema extraction
|
|
2
2
|
// They are lazy-loaded within the plugin when needed
|
|
3
|
-
export {
|
|
3
|
+
export { pageBridgePlugin, createPageBridgeStructureResolver, createPageBridgeStructure, PAGEBRIDGE_TYPES, } from "./plugin";
|
|
4
4
|
export { gscSite, gscSnapshot, gscRefreshTask, createGscSnapshot, createGscRefreshTask, } from "./schemas";
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultDocumentNodeResolver, StructureBuilder } from "sanity/structure";
|
|
2
|
-
export interface
|
|
2
|
+
export interface PageBridgePluginConfig {
|
|
3
3
|
/**
|
|
4
4
|
* Array of Sanity document type names that represent your content.
|
|
5
5
|
* These will be available for linking in gscSnapshot and gscRefreshTask schemas.
|
|
@@ -35,6 +35,6 @@ export declare const createPageBridgeStructure: (S: StructureBuilder) => import(
|
|
|
35
35
|
* Creates a structure resolver that adds the Performance view to content types
|
|
36
36
|
* Use this with structureTool's defaultDocumentNode option
|
|
37
37
|
*/
|
|
38
|
-
export declare const
|
|
39
|
-
export declare const
|
|
38
|
+
export declare const createPageBridgeStructureResolver: (contentTypes?: string[]) => DefaultDocumentNodeResolver;
|
|
39
|
+
export declare const pageBridgePlugin: import("sanity").Plugin<void | PageBridgePluginConfig>;
|
|
40
40
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,2BAA2B,EAC3B,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAO1B,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,2BAA2B,EAC3B,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAO1B,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,uDAInB,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,yBAAyB,GAAI,GAAG,gBAAgB,+CAqBxD,CAAC;AAEN;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAC5C,eAAc,MAAM,EAAO,KAC1B,2BAiBF,CAAC;AAEF,eAAO,MAAM,gBAAgB,wDAuB3B,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -53,7 +53,7 @@ export const createPageBridgeStructure = (S) => S.listItem()
|
|
|
53
53
|
* Creates a structure resolver that adds the Performance view to content types
|
|
54
54
|
* Use this with structureTool's defaultDocumentNode option
|
|
55
55
|
*/
|
|
56
|
-
export const
|
|
56
|
+
export const createPageBridgeStructureResolver = (contentTypes = []) => {
|
|
57
57
|
return (S, { schemaType }) => {
|
|
58
58
|
if (contentTypes.includes(schemaType)) {
|
|
59
59
|
// Lazy import to avoid loading React component during schema extraction
|
|
@@ -69,7 +69,7 @@ export const createGscStructureResolver = (contentTypes = []) => {
|
|
|
69
69
|
return S.document().views([S.view.form()]);
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
export const
|
|
72
|
+
export const pageBridgePlugin = definePlugin((config) => {
|
|
73
73
|
const contentTypes = config?.contentTypes ?? [];
|
|
74
74
|
const gscSnapshot = createGscSnapshot({ contentTypes });
|
|
75
75
|
const gscRefreshTask = createGscRefreshTask({ contentTypes });
|
package/package.json
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagebridge/sanity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Sanity Studio plugin for PageBridge — performance pane, decay alerts, and refresh queue powered by Google Search Console data",
|
|
4
5
|
"license": "MIT",
|
|
5
6
|
"private": false,
|
|
6
7
|
"type": "module",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"pagebridge",
|
|
10
|
+
"sanity",
|
|
11
|
+
"sanity-plugin",
|
|
12
|
+
"sanity-studio",
|
|
13
|
+
"google-search-console",
|
|
14
|
+
"gsc",
|
|
15
|
+
"seo",
|
|
16
|
+
"content-decay",
|
|
17
|
+
"search-performance",
|
|
18
|
+
"cms",
|
|
19
|
+
"content-refresh"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"LICENSE",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
7
26
|
"exports": {
|
|
8
27
|
".": {
|
|
9
28
|
"types": "./dist/index.d.ts",
|
package/.turbo/turbo-build.log
DELETED