{"_id":"@burgersonbrioche/sanity-scheduled-publishing","name":"@burgersonbrioche/sanity-scheduled-publishing","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@burgersonbrioche/sanity-scheduled-publishing","version":"1.0.0","description":"## This is forked from @sanity/scheduled-publishing and adds unpublishing","keywords":["sanity","plugin"],"homepage":"https://github.com/BurgersOnBrioche/sanity-plugin-scheduled-publishing#readme","bugs":{"url":"https://github.com/BurgersOnBrioche/sanity-plugin-scheduled-publishing/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/BurgersOnBrioche/sanity-plugin-scheduled-publishing.git"},"license":"MIT","author":{"name":"Burgers On Brioche","email":"support@burgersonbrioche.com"},"contributors":[{"name":"Sanity.io","email":"hello@sanity.io"}],"exports":{".":{"types":"./lib/src/index.d.ts","source":"./src/index.ts","import":"./lib/index.esm.js","require":"./lib/index.js","default":"./lib/index.esm.js"},"./package.json":"./package.json"},"main":"./lib/index.js","module":"./lib/index.esm.js","source":"./src/index.ts","types":"./lib/src/index.d.ts","scripts":{"prebuild":"npm run clean && plugin-kit verify-package --silent && pkg-utils","build":"pkg-utils build --strict","clean":"rimraf lib","compile":"tsc --noEmit","dev":"npm run watch","format":"prettier src -w","link-watch":"plugin-kit link-watch","lint":"eslint .","prepare":"husky install","prepublishOnly":"npm run build","release":"standard-version","verify":"npm run compile && npm run lint","watch":"pkg-utils watch"},"dependencies":{"@sanity/color":"^2.1.20","@sanity/icons":"^2.0.0","@sanity/incompatible-plugin":"^1.0.4","@sanity/ui":"^1.0.0","@sanity/util":"^3.0.0","@tanstack/react-virtual":"^3.0.1","@vvo/tzdb":"^6.75.0","date-fns":"^2.29.3","date-fns-tz":"^2.0.0","debug":"^4.3.4","lodash":"^4.17.21","pluralize":"^8.0.0","react-focus-lock":"^2.9.1","rxjs":"^7.5.7","swr":"^1.3.0"},"devDependencies":{"@commitlint/cli":"^17.2.0","@commitlint/config-conventional":"^17.2.0","@sanity/pkg-utils":"^1.17.3","@sanity/plugin-kit":"^2.1.17","@sanity/semantic-release-preset":"^4.1.2","@types/debug":"^4.1.7","@types/lodash":"^4.14.187","@types/pluralize":"^0.0.29","@types/react":"^18","@types/react-dom":"^18","@types/styled-components":"^5.1.26","@typescript-eslint/eslint-plugin":"^5.42.0","@typescript-eslint/parser":"^5.42.0","eslint":"^8.26.0","eslint-config-prettier":"^8.5.0","eslint-config-sanity":"^6.0.0","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.31.10","eslint-plugin-react-hooks":"^4.6.0","husky":"^8.0.1","lint-staged":"^13.0.3","lodash":"^4.17.21","prettier":"^2.7.1","prettier-plugin-packagejson":"^2.3.0","react":"^18","react-dom":"^18","rimraf":"^5.0.0","sanity":"^3.0.0","semantic-release":"^21.0.7","typescript":"^4.8.4"},"peerDependencies":{"@sanity/ui":"^1.0 || ^2.0","react":"^18","react-dom":"^18","sanity":"^3.0.0","styled-components":"^5.0 || ^6.0"},"engines":{"node":">=14"},"publishConfig":{"access":"public","provenance":true},"sanityExchangeUrl":"https://www.sanity.io/plugins/scheduled-publishing","_id":"@burgersonbrioche/sanity-scheduled-publishing@1.0.0","gitHead":"633bac52024af00d2e4fe11c79e769ce038fdcc0","_nodeVersion":"20.11.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-/2X63ZAVLbuEnPfQF6ktRxtclpf0rPbehgTomo+VHS0Aw05k/eFI4/4UTPpYx+ZeQkccztd0T/AjcN3izST63Q==","shasum":"f03410873f7d39061709993de3b80265e7d190f9","tarball":"https://registry.npmjs.org/@burgersonbrioche/sanity-scheduled-publishing/-/sanity-scheduled-publishing-1.0.0.tgz","fileCount":120,"unpackedSize":921233,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@burgersonbrioche%2fsanity-scheduled-publishing@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBPgQEWfMBdL3kBcOjEFgI7z88W1S1M2utR4gEpAFYaGAiEAnT8kmpyvIJlpGp7XPiiynnO8ex6C7Kuwb3/GY66XyC0="}]},"_npmUser":{"name":"burgersonbrioche","email":"burgersonbrioche@gmail.com"},"directories":{},"maintainers":[{"name":"burgersonbrioche","email":"burgersonbrioche@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sanity-scheduled-publishing_1.0.0_1709691082557_0.6762783066358036"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-06T02:11:22.444Z","1.0.0":"2024-03-06T02:11:22.816Z","modified":"2024-03-06T02:11:23.541Z"},"maintainers":[{"name":"burgersonbrioche","email":"burgersonbrioche@gmail.com"}],"description":"## This is forked from @sanity/scheduled-publishing and adds unpublishing","homepage":"https://github.com/BurgersOnBrioche/sanity-plugin-scheduled-publishing#readme","keywords":["sanity","plugin"],"repository":{"type":"git","url":"git+ssh://git@github.com/BurgersOnBrioche/sanity-plugin-scheduled-publishing.git"},"contributors":[{"name":"Sanity.io","email":"hello@sanity.io"}],"author":{"name":"Burgers On Brioche","email":"support@burgersonbrioche.com"},"bugs":{"url":"https://github.com/BurgersOnBrioche/sanity-plugin-scheduled-publishing/issues"},"license":"MIT","readme":"# Scheduled Publishing and Unpublishing plugin for Sanity.io\n\n## This is forked from @sanity/scheduled-publishing and adds unpublishing \n\n> This is a **Sanity Studio v3** plugin.\n> For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/sanity-plugin-scheduled-publishing/tree/studio-v2).\n\n## What is it?\n\nSchedule your content for future publication and organise upcoming releases – no custom tasks or serverless functions required!\n\n> This plugin uses Sanity's [Scheduling API][scheduling-api] which is available to customers on [Growth or higher plans][pricing].\n\n![Scheduled Publishing tool view](https://user-images.githubusercontent.com/209129/159557062-6d3ea6d7-941e-472a-a7d4-7e229bf81780.png)\n\n![Scheduled Publishing document view](https://user-images.githubusercontent.com/209129/159463180-703d557a-cfe6-4ff0-970f-b33eea048e87.png)\n\n## Table of contents\n\n- [Features](#features)\n- [Getting started](#getting-started)\n  - [Install](#install)\n  - [Usage](#usage)\n    - [Manually configuring the Schedule document action](#manually-configuring-the-schedule-document-action)\n    - [Manually configuring the Schedule document badge](#manually-configuring-the-scheduled-document-badge)\n- [FAQ](#faq)\n- [Changes from Sanity Studio v2 version](#changes-from-sanity-studio-v2-version)\n\n## Features\n\n### Create and edit schedules directly from the document editor\n\n- Create and edit schedules for the document you're working on\n- See current schedule status and potential validation issues\n\n### View all your schedules with our dedicated tool\n\n- Filter all schedules by status or use the calendar to browse by date\n- Edit, delete, and immediately publish schedules\n- Automatically validate upcoming schedules, and identify issues before they're published\n- Easily identify who created a schedule\n\n### View schedule dates in any remote time zone\n\n<img src=\"https://user-images.githubusercontent.com/209129/159458620-ce6b8112-c19a-4c24-a2d5-f79798d1e6f7.png\" width=\"600\" />\n\n- Change the time zone you want to preview schedules in by clicking the 🌎 **Time Zone** button when visible. Great when you need to co-ordinate with a global team or want to time publication to specific regions.\n- Easily select time zones by city, time zone abbreviation or name search.\n- Selected time zones are automatically stored in your local storage for future use.\n\n# Getting started\n\n## Installation\n\n```\nnpm install --save @burgersonbrioche/sanity-scheduled-publishing\n```\n\nor\n\n```\nyarn add @burgersonbrioche/sanity-scheduled-publishing\n```\n\n## Usage\n\nAdd it as a plugin in sanity.config.ts (or .js):\n\n```js\nimport {scheduledPublishing} from '@burgersonbrioche/sanity-scheduled-publishing'\n\nexport default defineConfig({\n  // ...\n  plugins: [scheduledPublishing()],\n})\n```\n\n**This will automatically:**\n\n1. Add a Schedule [document action][document-actions] to all document schema types\n2. Display a Scheduled [document badge][document-badges] to all document schema types\n3. Add the dedicated Schedules tool in your navigation bar\n\n### Customize input date formatting\n\nTo change the date formatting used when creating and editing schedules, pass a [valid `date-fns` formatted token](https://date-fns.org/docs/format) as an option.\n\n```js\n  plugins: [\n    // Make sure to specify a time component if you're specifying a custom format!\n    scheduledPublishing({\n      // E.g. 12/25/2000 6:30 AM\n      inputDateTimeFormat: 'MM/dd/yyyy h:mm a',\n    })\n  ],\n```\n\nIf left unspecified, this plugin will default to `dd/MM/yyyy HH:mm`.\n\n### Configure the document action\n\nThis example assumes [you've customized your document actions][document-actions] and would like to only show the Schedule button on `movie` documents only.\n\nThe Schedule document action allows users to both create and edit existing schedules directly from the form editor. It is added to all document types by the plugin,\nso you should remove it from types that should NOT have it.\n\n```js\nimport {scheduledPublishing, ScheduleAction} from '@burgersonbrioche/sanity-scheduled-publishing'\n\nexport default defineConfig({\n  // ...\n  plugins: [scheduledPublishing()],\n  document: {\n    actions: (previousActions, {schemaType}) => {\n      /*\n       * Please note that this will only alter the visibility of the button in the studio.\n       * Users with document publish permissions will be able to create schedules directly\n       * via the Scheduled Publishing API.\n       */\n      if (schemaType.name !== 'movie') {\n        // Remove the schedule action from any documents that is not 'movie'.\n        return previousActions.filter((action) => action !== ScheduleAction)\n      }\n      return previousActions\n    },\n  },\n})\n```\n\n### Configure the document badge\n\nThis example assumes [you've customised your own document badges][document-badges] and would like to only show the Scheduled badge on `movie` documents only.\n\nThe Scheduled document badge displays whether the current document is scheduled and when it will be published if so. It is added to all document types by the plugin,\nso you should remove it from types that should NOT have it.\n\n```js\nimport {scheduledPublishing, ScheduledBadge} from '@burgersonbrioche/sanity-scheduled-publishing'\n\nexport default defineConfig({\n  // ...\n  plugins: [scheduledPublishing()],\n  document: {\n    actions: (previousBadges, {schemaType}) => {\n      if (schemaType.name !== 'movie') {\n        // Remove the schedule badge from any documents that is not 'movie'.\n        return previousBadges.filter((badge) => badge !== ScheduledBadge)\n      }\n      return previousBadges\n    },\n  },\n})\n```\n\n## FAQ\n\n<details>\n<summary>What's the relationship between Schedules and my dataset?</summary>\n\nSchedules sit adjacent to your dataset and can be managed using the [Scheduling API][scheduling-api] (which this plugin does for you).\n\nSchedules are a unique resource and are linked to, but do not exist within your Sanity project and dataset. It's important to understand the following behavior:\n\n- As schedules are not contained within a project’s dataset, you cannot query them via GROQ or GraphQL.\n- Deleting a dataset will immediately delete all schedules.\n- Deleting a project will immediately delete all schedules.\n- `sanity dataset export` will not include schedules and `sanity dataset import` does not support importing schedules.\n- Server-side copying of datasets does not include schedules.\n- When a project is disabled or blocked, all scheduled publishes will invariably fail as mutations will not be allowed on the dataset.\n\nMore information can be found on the [Scheduling API][scheduling-api] page.\n\n</details>\n\n<details>\n<summary>Where is time zone data pulled from?</summary>\n\n- Time zones and their corresponding cities, regions and daylight savings offsets are directly sourced from the [@vvo/dztb][@vvo/dztb] library, which is automatically updated with data from [geonames.org](https://www.geonames.org/).\n- Latest time zone + region data from [@vvo/dztb][@vvo/dztb] is pulled in when first installing this plugin.\n- In the event you need to bring in upstream time zone and region data, run:\n\n  ```sh\n  # Yarn\n  yarn upgrade @burgersonbrioche/sanity-scheduled-publishing\n\n  # NPM\n  npm update @vvo/tzdb --legacy-peer-deps\n  ```\n\n</details>\n\n<details>\n<summary>Will scheduled documents with validation errors publish?</summary>\n\n- **Yes.** Documents scheduled to publish in future will do so, even if they contain validation errors. This also applies to scheduled documents that you manually opt to publish immediately via the tool.\n\n</details>\n\n### Changes from Sanity Studio v2 version\n\nThe Studio V3 version differs from the v2 versions in a few ways:\n\n- Actions and badges now auto-compose with other document actions by default. This is the _opposite_ of how the v2 version behaves:\n  It is no longer necessary to compose actions and badges manually when there are other plugins that add those to studio.\n- This means that you now have to _remove_ the Schedule Action from types that _should not_ have it, as opposed to _add_ it for those that should like in v2.\n\n## Develop & test\n\nThis plugin uses [@sanity/plugin-kit](https://github.com/sanity-io/plugin-kit)\nwith default configuration for build & watch scripts.\n\nSee [Testing a plugin in Sanity Studio](https://github.com/sanity-io/plugin-kit#testing-a-plugin-in-sanity-studio)\non how to run this plugin with hot-reload in the studio.\n\n### Release new version\n\nRun the [CI & Release workflow](https://github.com/sanity-io/sanity-plugin-scheduled-publishing/actions/workflows/main.yml).\nMake sure to select the main branch and check \"Release new version\".\n\nSemantic release will only release on configured branches, so it is safe to run release on any branch.\n\n[document-actions]: https://www.sanity.io/docs/document-actions\n[document-badges]: https://www.sanity.io/docs/custom-document-badges\n[scheduling-api]: https://www.sanity.io/docs/scheduling-api\n[@vvo/dztb]: https://github.com/vvo/tzdb\n[pricing]: https://www.sanity.io/pricing\n\n## License\n\nThis repository is published under the [MIT](LICENSE) license.\n","readmeFilename":"README.md"}