{"_id":"sanity-plugin-prefixed-slug","_rev":"2-8bb20735c0c446bb9c8b520f3cf9a89e","name":"sanity-plugin-prefixed-slug","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"sanity-plugin-prefixed-slug","version":"1.0.0","description":"Editor friendly slug fields for your Sanity.io studio","main":"lib/SlugInput.js","scripts":{"format":"prettier --write .","clear-lib":"node clearLib.js","build":"npm run format && npm run clear-lib && tsc","dev":"tsc -w","prepublish":"npm run build"},"repository":{"type":"git","url":"git+ssh://git@github.com/hdoro/sanity-plugin-prefixed-slug.git"},"keywords":["sanity.io","sanity","slug","sanity-plugin"],"author":{"name":"Henrique Doro","email":"opensource@hdoro.dev"},"license":"Apache-2.0","dependencies":{"@sanity/base":">= 2.5.0","@sanity/ui":">= 0.33.9","@sanity/util":">= 2.5.0","speakingurl":"^14.0.1"},"devDependencies":{"@types/react":"^17.0.0","@types/react-dom":"^17.0.0","@types/speakingurl":"^13.0.3","@types/styled-components":"^5.1.25","prettier":"^2.7.1","typescript":"^4.7.4"},"peerDependencies":{"react":"^17.0.0","styled-components":">= 5.0.0"},"bugs":{"url":"https://github.com/hdoro/sanity-plugin-better-slug/issues"},"homepage":"https://github.com/hdoro/sanity-plugin-better-slug#readme","eslintConfig":{"parser":"sanipack/babel/eslint-parser","extends":["sanity","sanity/react","prettier","prettier/react"]},"gitHead":"7fb68bcf722b282bb7b850cb01a339ef5327f819","_id":"sanity-plugin-prefixed-slug@1.0.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-2jf2bQkak743xJu8mqelBq8kECFb9zN7U2N8bLOV2z395YRMV9ElTYQiojH9vsFtWHjH0z5h3/z9mIMKeJCt5g==","shasum":"5b31433cd1a373fd896d817eb518cff2949d3f90","tarball":"https://registry.npmjs.org/sanity-plugin-prefixed-slug/-/sanity-plugin-prefixed-slug-1.0.0.tgz","fileCount":4,"unpackedSize":13011,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAyJNO4PTInl9mPMIR4n72t0idRQvmicmtKApiO12h4iAiAOgcAXZb3sA0ivbiLNIZRbeApjXayxAoQZRW1h+MpYLQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0X1WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrC/g/7BDXjRZgitr0r3XBqRTZmRoEctsEBNBssSVZrEe8F7E3UbkIc\r\ncCQ/Vqmv3XK2LX7GGKn+L6aL15LD4buOQV0FvQRH66hKtv/zcnP3FUOQsnOI\r\n1ml4Fb1aEBPUi9v9gaS9f64K9svAZkSTHWffIOxRZWH6ZcSyoRPextuLzeKm\r\nbx4Kh4UvW6knflzB2f4+7Nyn4/9G5WXZXS+TCsEBuddIsLEm2Q+a56Mm3k3H\r\neF+zkybFQI1m4/ksKpEn4uhpsXJaZcQp7/ziwHW4LyXtwo7ex6enLNyJTNrF\r\nUWXymEECWZL5QLI0cOpXSZfxTyb8j7A9YQaHUjLMdi2VwGXDk3WcB5gs7O4w\r\nHB4a8juzC6FMihvrPvSfipRdsdwMN+7e7ZQazIELueTx3tUdJkjkFoBbYYi5\r\n4VNBiFyaccAXuu998gDr9mshgXH/mSAc8V681zYJDkezCRkaPtyURMyps4ZO\r\ngCFx+dgeNpnjHSOIKo0ItS2rdSWFLCM38uA8fzW5rA+3Qc6L0cJiG5Z6V+yr\r\nCL4YYJmoZ2GIy23OKBP0ynzISGt4rAUkuYCwXW22tSpJo+d0fhizA8YefOl7\r\nvk0t0KKpymaKduGvow/AKiijzdwWbWO0In1ooL5inUJ5zUxF6lEiDGi/HnKB\r\nXxACuUKPKekpJg3xxTGCiKILmKynLT94MFk=\r\n=U5KV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hdoro","email":"opensource@hdoro.dev"},"directories":{},"maintainers":[{"name":"hdoro","email":"opensource@hdoro.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sanity-plugin-prefixed-slug_1.0.0_1657896278116_0.5124544922165477"},"_hasShrinkwrap":false},"1.0.1":{"name":"sanity-plugin-prefixed-slug","version":"1.0.1","description":"Editor friendly slug fields for your Sanity.io studio","main":"lib/SlugInput.js","scripts":{"format":"prettier --write .","clear-lib":"node clearLib.js","build":"npm run format && npm run clear-lib && tsc","dev":"tsc -w","prepublish":"npm run build"},"repository":{"type":"git","url":"git+ssh://git@github.com/hdoro/sanity-plugin-prefixed-slug.git"},"keywords":["sanity.io","sanity","slug","sanity-plugin"],"author":{"name":"Henrique Doro","email":"opensource@hdoro.dev"},"license":"Apache-2.0","dependencies":{"@sanity/base":">= 2.5.0","@sanity/ui":">= 0.33.9","@sanity/util":">= 2.5.0","speakingurl":"^14.0.1"},"devDependencies":{"@types/react":"^17.0.0","@types/react-dom":"^17.0.0","@types/speakingurl":"^13.0.3","@types/styled-components":"^5.1.25","prettier":"^2.7.1","typescript":"^4.7.4"},"peerDependencies":{"react":"^17.0.0","styled-components":">= 5.0.0"},"bugs":{"url":"https://github.com/hdoro/sanity-plugin-better-slug/issues"},"homepage":"https://github.com/hdoro/sanity-plugin-better-slug#readme","eslintConfig":{"parser":"sanipack/babel/eslint-parser","extends":["sanity","sanity/react","prettier","prettier/react"]},"gitHead":"eaa66e520323d88e598589b8e22258312c154918","_id":"sanity-plugin-prefixed-slug@1.0.1","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-u3RdktLyJd5NoIaPd1IBqfH33a/W+s8WvpuQ4QlQQo5MHxnQTwBkeA2tM+PadWG0idAeq08BqqbaZrhIuTk0Fg==","shasum":"3c1cab9cf507912633e8fc3e9a33f5430edba06d","tarball":"https://registry.npmjs.org/sanity-plugin-prefixed-slug/-/sanity-plugin-prefixed-slug-1.0.1.tgz","fileCount":4,"unpackedSize":13053,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOwzQQ308B/rMNqT4mKQKirsA4hkDQL24LOt+hwxhPfQIgSL779AoYCPbXVBQWGrmgIS/azIKs5pIN/+ET21rHHd0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi+rq8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrnYxAAj3HUaKxOaA5KgutA7peP+dGZu/f7rK/nGoan3b2dv9HlliMJ\r\nVTlojE5E8JNPzHKkWaY12ncA5ZESDoRLtXNj1xWQsf+p+0E7h12D6/+sZ3yD\r\nrhB/9umo2VdY8KRQy/2cpG0b31hR16V2qPtdTFJ0giH/n5dv2sqYakswHr+P\r\nGvcBnoek/Hg/K8TuCbzOnFPZ91ZKAGg3Bigidg5V+CjO3EZTtWfBr7/wWJPE\r\nmz7kbKduU8Dgnext4Zz+4vk9Zs/hhHDoqDn4b7Bht7jTbhWiGfAPY5BfzN+i\r\ncwkjMMHYAMwsIYW8T3P6y/IJqsVKOkZuI84tTGAr2mK3+qfeLkfmlR0Apt5T\r\nCPEeC1p/F+/dkml1mgB3tKvi1zybkDp6bbjIQGveeKnhV6qi1/HB8k+p4m+I\r\nGiv0roBmzjCgC8KaxNd9Ti7ADgXEHiwn6blfITuIu0wRRDpr7et7CAn+58gZ\r\nC29Q1zavrjfCnsY4qMEmzxtiUg/bnn8IVTj/k95ND3grlu4RcUDXSCkMDm/C\r\nmCAsrNEQ33nuLRvx042ehix1Z/mC7NOeunUoKcL/DMuw5vhyaiMo2veurw2d\r\nFS/wnvk1962ICMqAU++Yb7D/wEXYK7QmbsThkqvYcqyMWtawxrEoBjL7Aunv\r\nNiVYJupnqYU9UxwdlikRh81pZW5X+P69Azw=\r\n=UpMw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hdoro","email":"opensource@hdoro.dev"},"directories":{},"maintainers":[{"name":"hdoro","email":"opensource@hdoro.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sanity-plugin-prefixed-slug_1.0.1_1660598972438_0.23018530937435377"},"_hasShrinkwrap":false},"2.0.0":{"name":"sanity-plugin-prefixed-slug","version":"2.0.0","description":"Editor friendly slug fields for your Sanity.io studio","keywords":["sanity.io","sanity","slug","sanity-plugin"],"homepage":"https://github.com/hdoro/sanity-plugin-prefixed-slug#readme","bugs":{"url":"https://github.com/hdoro/sanity-plugin-prefixed-slug/issues"},"repository":{"type":"git","url":"git+https://github.com/hdoro/sanity-plugin-prefixed-slug.git"},"license":"Apache-2.0","author":{"name":"Henrique Doro","email":"opensource@hdoro.dev"},"type":"commonjs","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","clean":"rimraf lib","clear-lib":"node clearLib.js","dev":"tsc -w","format":"prettier --write .","link-watch":"plugin-kit link-watch","lint":"eslint .","prepublishOnly":"npm run build","prepublish":"npm run build","watch":"pkg-utils watch"},"eslintConfig":{"parser":"sanipack/babel/eslint-parser","extends":["sanity","sanity/react","prettier","prettier/react"]},"dependencies":{"@sanity/incompatible-plugin":"^1.0.4","@sanity/ui":"^1.0.0","speakingurl":"^14.0.1"},"devDependencies":{"@sanity/pkg-utils":"^2.0.0","@sanity/plugin-kit":"^2.2.0","@types/react":"^18","@types/react-dom":"^18","@types/speakingurl":"^13.0.3","@types/styled-components":"^5.1.25","@typescript-eslint/eslint-plugin":"^5.47.0","@typescript-eslint/parser":"^5.47.0","eslint":"^8.30.0","eslint-config-prettier":"^8.5.0","eslint-config-sanity":"^6.0.0","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.31.11","eslint-plugin-react-hooks":"^4.6.0","prettier":"^2.8.1","prettier-plugin-packagejson":"^2.3.0","react":"^18","rimraf":"^3.0.2","sanity":"^3.0.0","typescript":"^4.9.4"},"peerDependencies":{"react":"^18","sanity":"^3.0.0","styled-components":">= 5.0.0"},"engines":{"node":">=14"},"sanityExchangeUrl":"https://www.sanity.io/plugins/prefixed-slug","gitHead":"7f6a0187d2875e1c522786765eb87fa4711c3458","_id":"sanity-plugin-prefixed-slug@2.0.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-h/2BPcFwgmw4e+h5Gv6ZompYSMcffha2tSa1wXxdOL8nUbs8Cs5vBz6A0G9UT3fG1ByF5Lx4qQ7UEwsy0Y8W5w==","shasum":"7793a00abbbb6e8d97e356a526214666205fa132","tarball":"https://registry.npmjs.org/sanity-plugin-prefixed-slug/-/sanity-plugin-prefixed-slug-2.0.0.tgz","fileCount":15,"unpackedSize":520544,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyTfJDtobZ4caLvTjAulm1QT6X6OxdXrP3wUfEXtItBwIgXH3R70l1ZRWgNlgil9Gpm1RFZFxU7H3aWuQF0KhV3c8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjqv6ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVsg/9HIwvbwalS5Q3/x0YcROdYm2iSQHh0sQVuHhDVGEdwF80Qka4\r\nVaTJfRfEiLEbLNXQDKd2F8cG9TFom/a23xAuELlwMgFkrKhpKY9uUXecvFRV\r\nRi7ovdnRrt0WRDcOZwwxmF9qW4qDp1ySiiDwOtgw78WOcKcGrQz3SDarjtS3\r\nYqBeIOK2g1h0GnDgUARWRuNtT1SMRbs+lHILZ3MtOOgyQCbjhX3xb/ENHusL\r\n6aJpVuzh2HwT2y/AsT6L4KmXQqefzuuF6hl+k8RQychcT5VzyCLnH6rGga6c\r\nXeW0CUirJm+0X6TOVqZygZLGUM0RxZxv+0t6dLtuJD/f0mS4qWDgme9g0O4K\r\nJH4eYLMp+LJa2Zbdl9ugyEMnzQE0dvtPPZsm2wV28pt+Ygmz4PaKMa+7qFS/\r\nomSFKCrGLL+A83eepoz2kENZ5u3Gq5nTy+14VLvqLfwTYU13RBCO7xasI8/H\r\n0WwdTPhEF6Z+pjjTc3eerh73CBF3kOraX9m5Ejd3H5ahZmuECEen1u9CE2pH\r\n6RD8VgPN22pq2WHJrqgDnBqQFDNSeLuvu/ubpSwVDYxx7Rp7o/VCF6WbAp8+\r\nyH5eMrodEKUXCUv/s6EITjHa0Y2Q2QCKnYdVpm/VEOW5R3wAqu4cgA3211yQ\r\njdmDnKd9bjUfWl2p+/mM0jDDSZ06/mcdtaI=\r\n=1kBj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hdoro","email":"opensource@hdoro.dev"},"directories":{},"maintainers":[{"name":"hdoro","email":"opensource@hdoro.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sanity-plugin-prefixed-slug_2.0.0_1672150680769_0.17867001762459567"},"_hasShrinkwrap":false}},"time":{"created":"2022-07-15T14:44:38.116Z","1.0.0":"2022-07-15T14:44:38.360Z","modified":"2022-12-27T14:18:01.111Z","1.0.1":"2022-08-15T21:29:32.657Z","2.0.0":"2022-12-27T14:18:01.023Z"},"maintainers":[{"name":"hdoro","email":"opensource@hdoro.dev"}],"description":"Editor friendly slug fields for your Sanity.io studio","homepage":"https://github.com/hdoro/sanity-plugin-prefixed-slug#readme","keywords":["sanity.io","sanity","slug","sanity-plugin"],"repository":{"type":"git","url":"git+https://github.com/hdoro/sanity-plugin-prefixed-slug.git"},"author":{"name":"Henrique Doro","email":"opensource@hdoro.dev"},"bugs":{"url":"https://github.com/hdoro/sanity-plugin-prefixed-slug/issues"},"license":"Apache-2.0","readme":"# sanity-plugin-prefixed-slug\n\nEditor friendly slug fields for your Sanity.io studio. Prefixed URLs and auto-slugifying values.\n\n![Screenshot of the plugin in action](src/demo.gif)\n\n## Installation\n\nStart by enabling it in your Sanity V3 studio:\n\n```bash\nyarn add sanity-plugin-prefixed-slug\n# or npm\nnpm i sanity-plugin-prefixed-slug\n```\n\n🚨 If you're using Sanity V2, use the `^1.0.0` releases of this plugin.\n\nThen, use the custom input component in your `slug` field(s):\n\n```js\nimport { SlugInput } from 'sanity-plugin-prefixed-slug'\n\nexport default {\n  name: 'testing-slugs',\n  type: 'document',\n  fields: [\n    {\n      name: 'slug_regular_custom_input',\n      type: 'slug',\n      // Add the custom input to the `component` object of your field\n      components: {\n        input: SlugInput,\n      },\n      options: {\n        source: 'title',\n        urlPrefix: 'https://site.url',\n        // Use isUnique/maxLength just like you would w/ the regular slug field\n        isUnique: MyCustomIsUniqueFunction,\n        maxLength: 30,\n        // If you want to save the full URL in the slug object, set storeFullUrl to `true`\n        // Example storage: { _type: \"slug\", current: \"my-slug\", fullUrl: \"https://site.com/my-slug\" }\n        storeFullUrl: true,\n      },\n    },\n    {\n      // If you want to customize how slugs are formatted\n      name: 'slug_custom_format',\n      type: 'slug',\n      components: {\n        input: SlugInput,\n      },\n      options: {\n        urlPrefix: 'https://site.url',\n        slugify: (slugString) => slugString.toLowerCase(),\n        // You can also avoid slugifying entirely by returning the full value:\n        slugify: (slugString) => slugString,\n      },\n    },\n    {\n      // If you want to provide a custom path based on the current document:\n      name: 'slug_function_path',\n      type: 'slug',\n      components: {\n        input: SlugInput,\n      },\n      options: {\n        urlPrefix: (document) => `https://site.url/${document.lang}`,\n        // It could even be a promise! 🛑 Be careful: this will be triggered on every document change.\n        urlPrefix: async (document) => {\n          const subPath = await getDocumentSubPath(document) // ficticious asynchronous method\n          return `https://site.url/${subPath}`\n        },\n      },\n    },\n  ],\n}\n```\n\n💡 This plugin used to be called `sanity-plugin-better-slug`. As that was pretentious and unclear, I've made the switch to `prefixed-slug`.\n\nUpgrading from sanity-plugin-better-slug? Rename your `options.basePath` to `options.urlPrefix`.\n","readmeFilename":"README.md"}