@fils/sanity-components 0.0.5 → 0.0.7

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/README.md CHANGED
@@ -5,6 +5,8 @@ You will need top have a `.env` file properly set up in your project.
5
5
 
6
6
  This is part of a series of packages that we use in our studio for personal and commercial web & [THREEjs](https://threejs.org) based work. It might remain undocumented for a long while but feel free to try it out!
7
7
 
8
+ This package is discontinued. Back-End components & our publishing workflow will be moved into a private NPM package at GitHub.
9
+
8
10
  ### License
9
11
  © Copyright 2025, fil studio
10
12
 
@@ -1,12 +1,12 @@
1
1
  export declare const SEO: {
2
- type: "document";
2
+ type: "object";
3
3
  name: "seo";
4
- } & Omit<import("sanity").DocumentDefinition, "preview"> & {
4
+ } & Omit<import("sanity").ObjectDefinition, "preview"> & {
5
5
  preview?: import("sanity").PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
6
6
  };
7
7
  export declare const LocalizedSEO: {
8
- type: "document";
8
+ type: "object";
9
9
  name: "localseo";
10
- } & Omit<import("sanity").DocumentDefinition, "preview"> & {
10
+ } & Omit<import("sanity").ObjectDefinition, "preview"> & {
11
11
  preview?: import("sanity").PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
12
12
  };
@@ -3,7 +3,7 @@ import { SEOImage } from "./SEOImage";
3
3
  export const SEO = defineType({
4
4
  name: 'seo',
5
5
  title: "SEO",
6
- type: "document",
6
+ type: "object",
7
7
  fields: [
8
8
  defineField({
9
9
  name: 'title',
@@ -19,7 +19,7 @@ export const SEO = defineType({
19
19
  export const LocalizedSEO = defineType({
20
20
  name: 'localseo',
21
21
  title: "SEO",
22
- type: "document",
22
+ type: "object",
23
23
  fields: [
24
24
  defineField({
25
25
  name: 'title',
@@ -1,5 +1,6 @@
1
1
  import { DocumentActionComponent, DocumentActionsContext } from "sanity";
2
2
  import { StructureResolver } from 'sanity/structure';
3
+ import { SiteWidgetOption } from "sanity-plugin-dashboard-widget-netlify";
3
4
  export declare function getActions(singletonTypes: Set<string>): (input: DocumentActionComponent[], context: DocumentActionsContext) => DocumentActionComponent[];
4
5
  export declare function getDefaultConfig(projectId: string, title: string, structure: StructureResolver, schemaTypes: any, singletonTypes: Set<string>): {
5
6
  name: string;
@@ -18,3 +19,20 @@ export declare function getDefaultConfig(projectId: string, title: string, struc
18
19
  actions: (input: DocumentActionComponent[], context: DocumentActionsContext) => DocumentActionComponent[];
19
20
  };
20
21
  };
22
+ export declare function getConfigWithNetlify(projectId: string, title: string, structure: StructureResolver, schemaTypes: any, singletonTypes: Set<string>, sites: SiteWidgetOption[]): {
23
+ name: string;
24
+ title: string;
25
+ projectId: string;
26
+ dataset: string;
27
+ scheduledPublishing: {
28
+ enabled: false;
29
+ };
30
+ plugins: import("sanity").PluginOptions[];
31
+ schema: {
32
+ types: any;
33
+ templates: (templates: import("sanity").Template<any, any>[]) => import("sanity").Template<any, any>[];
34
+ };
35
+ document: {
36
+ actions: (input: DocumentActionComponent[], context: DocumentActionsContext) => DocumentActionComponent[];
37
+ };
38
+ };
@@ -1,5 +1,7 @@
1
1
  import { defineConfig } from "sanity";
2
2
  import { structureTool } from 'sanity/structure';
3
+ import { netlifyWidget } from "sanity-plugin-dashboard-widget-netlify";
4
+ import { dashboardTool } from '@sanity/dashboard';
3
5
  // Define the actions that should be available for singleton documents
4
6
  const singletonActions = new Set(["publish", "discardChanges", "restore"]);
5
7
  export function getActions(singletonTypes) {
@@ -31,3 +33,37 @@ export function getDefaultConfig(projectId, title, structure, schemaTypes, singl
31
33
  },
32
34
  });
33
35
  }
36
+ export function getConfigWithNetlify(projectId, title, structure, schemaTypes, singletonTypes, sites) {
37
+ return defineConfig({
38
+ name: 'default',
39
+ title,
40
+ projectId,
41
+ dataset: 'production',
42
+ scheduledPublishing: {
43
+ enabled: false
44
+ },
45
+ plugins: [
46
+ structureTool({
47
+ structure
48
+ }),
49
+ dashboardTool({
50
+ widgets: [
51
+ netlifyWidget({
52
+ title: 'Deploy Site',
53
+ sites
54
+ })
55
+ ]
56
+ })
57
+ ],
58
+ schema: {
59
+ types: schemaTypes,
60
+ // Filter out singleton types from the global “New document” menu options
61
+ templates: (templates) => templates.filter(({ schemaType }) => !singletonTypes.has(schemaType)),
62
+ },
63
+ document: {
64
+ // For singleton types, filter out actions that are not explicitly included
65
+ // in the `singletonActions` list defined above
66
+ actions: getActions(singletonTypes),
67
+ },
68
+ });
69
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fils/sanity-components",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Fil's Components for Sanity Back-Ends",
5
5
  "main": "lib/main.js",
6
6
  "repository": "git@github.com:fil-studio/fils.git",
@@ -14,13 +14,18 @@
14
14
  "files": [
15
15
  "lib"
16
16
  ],
17
- "dependencies": {
18
- "sanity": "^3.85.1"
17
+ "peerDependencies": {
18
+ "@sanity/dashboard": "^4.1.3",
19
+ "sanity": "^3.85.1",
20
+ "sanity-plugin-dashboard-widget-netlify": "^2.0.1"
19
21
  },
20
22
  "devDependencies": {
21
23
  "@sanity/types": "^3.85.1",
22
24
  "@types/react": "^19.1.2",
23
25
  "@types/react-dom": "^19.1.2",
24
- "typescript": "^5.8.3"
26
+ "typescript": "^5.8.3",
27
+ "sanity": "^3.85.1",
28
+ "@sanity/dashboard": "^4.1.3",
29
+ "sanity-plugin-dashboard-widget-netlify": "^2.0.1"
25
30
  }
26
31
  }