snagset 0.0.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/dist/vue.js ADDED
@@ -0,0 +1,55 @@
1
+ import { defineComponent, onBeforeUnmount, onMounted } from "vue";
2
+ import { init } from "./index.js";
3
+ /**
4
+ * `snagset/vue` — D63.
5
+ *
6
+ * ```vue
7
+ * <script setup>
8
+ * import { Snagset } from "snagset/vue";
9
+ * </script>
10
+ *
11
+ * <template>
12
+ * <Snagset host="https://review.example.com" site="prj_…" />
13
+ * </template>
14
+ * ```
15
+ *
16
+ * Same shape as the React one and for the same reason: renders nothing, mounts
17
+ * on mount, tears down on unmount. `vue` is an optional peer dependency.
18
+ *
19
+ * Written with `defineComponent` and a render function rather than as an SFC
20
+ * because an SFC needs `@vitejs/plugin-vue` at BUILD time — in this package's
21
+ * build, not the consumer's. A component that renders null does not need a
22
+ * template compiler, and adding one would make the Vue subpath the only part
23
+ * of this package that cannot be built by `tsc`.
24
+ */
25
+ export const Snagset = defineComponent({
26
+ name: "Snagset",
27
+ props: {
28
+ host: { type: String, required: true },
29
+ site: { type: String, required: true },
30
+ env: String,
31
+ mode: String,
32
+ theme: String,
33
+ lang: String,
34
+ position: String,
35
+ hotkey: String,
36
+ branch: String,
37
+ build: String,
38
+ storage: String,
39
+ badge: String,
40
+ autoMount: String,
41
+ },
42
+ setup(props) {
43
+ let teardown;
44
+ onMounted(() => {
45
+ // `{ ...props }` rather than `props`: Vue's props object is a reactive
46
+ // proxy, and handing it to a plain function that iterates it later would
47
+ // read values through the proxy outside of any effect scope.
48
+ teardown = init({ ...props });
49
+ });
50
+ onBeforeUnmount(() => teardown?.());
51
+ return () => null;
52
+ },
53
+ });
54
+ export default Snagset;
55
+ //# sourceMappingURL=vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vue.js","sourceRoot":"","sources":["../src/vue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAiB,MAAM,KAAK,CAAC;AACjF,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;IACrC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtC,GAAG,EAAE,MAAM;QACX,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,MAA0B;QACjC,SAAS,EAAE,MAA0B;KACtC;IACD,KAAK,CAAC,KAAK;QACT,IAAI,QAAkC,CAAC;QACvC,SAAS,CAAC,GAAG,EAAE;YACb,uEAAuE;YACvE,yEAAyE;YACzE,6DAA6D;YAC7D,QAAQ,GAAG,IAAI,CAAC,EAAE,GAAG,KAAK,EAAiB,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,eAAe,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACpC,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IACpB,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC"}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "snagset",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "Click-to-comment review for a live website. One import, or one script tag. Framework subpaths for React, Vue, Next.js, Vite and Astro.",
7
+ "license": "MIT",
8
+ "keywords": [
9
+ "review",
10
+ "feedback",
11
+ "annotation",
12
+ "qa",
13
+ "widget",
14
+ "react",
15
+ "vue",
16
+ "astro",
17
+ "nextjs",
18
+ "vite"
19
+ ],
20
+ "sideEffects": false,
21
+ "exports": {
22
+ ".": "./dist/index.js",
23
+ "./vanilla": "./dist/index.js",
24
+ "./react": "./dist/react.js",
25
+ "./vue": "./dist/vue.js",
26
+ "./astro": "./dist/astro.js",
27
+ "./next": "./dist/next.js",
28
+ "./vite": "./dist/vite.js",
29
+ "./package.json": "./package.json"
30
+ },
31
+ "peerDependencies": {
32
+ "react": ">=17",
33
+ "vue": ">=3"
34
+ },
35
+ "peerDependenciesMeta": {
36
+ "react": {
37
+ "optional": true
38
+ },
39
+ "vue": {
40
+ "optional": true
41
+ }
42
+ },
43
+ "scripts": {
44
+ "typecheck": "tsc -p tsconfig.json --noEmit",
45
+ "test": "node --experimental-strip-types --test test/*.test.ts",
46
+ "build": "node scripts/build.mjs",
47
+ "prepack": "node scripts/build.mjs && node ../../tools/publish-manifest.mjs strip",
48
+ "postpack": "node ../../tools/publish-manifest.mjs restore"
49
+ },
50
+ "files": [
51
+ "dist",
52
+ "README.md",
53
+ "LICENSE"
54
+ ],
55
+ "engines": {
56
+ "node": ">=18"
57
+ },
58
+ "publishConfig": {
59
+ "access": "public"
60
+ },
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "git+https://github.com/snagset/snagset.git",
64
+ "directory": "packages/widget-npm"
65
+ },
66
+ "homepage": "https://github.com/snagset/snagset",
67
+ "bugs": {
68
+ "url": "https://github.com/snagset/snagset/issues"
69
+ }
70
+ }