playhtml 2.1.12-beta.0 → 2.2.0

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "playhtml",
3
3
  "title": "playhtml",
4
4
  "description": "Create interactive, collaborative html elements with a single attribute",
5
- "version": "2.1.12-beta.0",
5
+ "version": "2.2.0",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "keywords": [
@@ -48,21 +48,30 @@
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsc && vite build",
51
- "set-publishing-config": "yarn config set version-tag-prefix 'playhtml-v' && yarn config set version-git-message 'playhtml-v%s'",
52
- "publish-npm": "(yarn run build && npm run set-publishing-config && rm README.md && cp ../../README.md . && yarn publish && yarn run cleanup) || (yarn run cleanup)",
53
- "publish-beta-npm": "(yarn run build && npm run set-publishing-config && rm README.md && cp ../../README.md . && yarn publish --tag beta && yarn run cleanup) || (yarn run cleanup)",
51
+ "test": "vitest run --no-typecheck",
52
+ "test:watch": "vitest --no-typecheck",
53
+ "version-patch": "bun pm version patch",
54
+ "version-minor": "bun pm version minor",
55
+ "version-major": "bun pm version major",
56
+ "publish": "(bun run build && rm README.md && cp ../../README.md . && bun publish && bun run cleanup) || (bun run cleanup)",
57
+ "release-patch": "bun run version-patch && bun run publish",
58
+ "release-minor": "bun run version-minor && bun run publish",
59
+ "release-major": "bun run version-major && bun run publish",
54
60
  "cleanup": "rm README.md && ln -s ../../README.md ."
55
61
  },
56
62
  "devDependencies": {
57
63
  "sass": "^1.62.1",
58
64
  "typescript": "^5.0.2",
59
65
  "vite": "^4.3.9",
60
- "vite-plugin-dts": "^3.0.3"
66
+ "vite-plugin-dts": "^3.0.3",
67
+ "vitest": "^3.1.1",
68
+ "jsdom": "^26.1.0"
61
69
  },
62
70
  "dependencies": {
63
- "@playhtml/common": "^0.0.13",
64
- "y-indexeddb": "^9.0.12",
65
- "y-partykit": "0.0.31",
71
+ "@playhtml/common": "0.1.0",
72
+ "@syncedstore/core": "^0.6.0",
73
+ "y-indexeddb": "^9.0.11",
74
+ "y-partykit": "^0.0.31",
66
75
  "yjs": "13.6.18"
67
76
  }
68
77
  }
package/CHANGELOG.md DELETED
@@ -1,92 +0,0 @@
1
- # Change Log
2
-
3
- The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
4
-
5
- ## 2.1.12 - 2024-08-13
6
-
7
- - try removing indexeddb to fix compatibility issue.
8
-
9
- ## 2.1.6 - 2024-04-17
10
-
11
- - fix bug with native image dragging conflicting with playhtml draggable elements.
12
-
13
- ## 2.1.2 - 2024-01-30
14
-
15
- - align dependencies
16
-
17
- ## 2.1.1 - 2024-01-30
18
-
19
- - added an `init.js` file export which can be imported to auto-initialize with default settings. Designed to be simplest way to get started with playhtml.
20
-
21
- ## 2.1.0 - 2024-01-27
22
-
23
- - **NEW FEATURE** Added eventing support for imperative logic like showing confetti whenever someone clicks a button which don't depend on a reacting to a data value changing. See the README under "eventing" for more details on how to set this up.
24
- - **BREAKING CHANGE** Changed the hash function used to generate element ids to be a stable length for long-term scalability. This will cause all elements without an `id` to be re-created to lose any persistent historical data. This was done to avoid duplicates and to swap to using a standard-length hash function (SHA-1). We still recommend you setting a unique `id` for each element to avoid any potential duplicates in the future, and using `selectorId` will not be affected by this change.
25
-
26
- ## 2.0.16 - 2024-01-04
27
-
28
- - **BREAKING CHANGE** deprecated using non-object values as `defaultData` for elements. If you were using a single value before, instead, use an object with a `value` key. e.g. `defaultData: { value: "my value" }`. This allows for easier extension of the data in the future.
29
- - **BREAKING CHANGE** deprecated `playhtml.init()` automatically being called to avoid side-effects upon import. This has been replaced with a new `init` file that you can directly import if you'd like to auto-initialize without any settings. See the README for more details.
30
- - exported `setupPlayElements` to call to look for any new elements to initialize
31
-
32
- ## 2.0.7 - 2023-10-02
33
-
34
- - upgrading y-partykit and yjs to latest for improved performance
35
-
36
- ## 2.0.5 - 2023-09-11
37
-
38
- - fixed an error with setting up elements before the provider was synced which lead to incorrect initial element states that didn't sync.
39
- - Removed the `firstSetup` export accordingly to allow for optimistically setting up elements even before `playhtml` is initialized.
40
- - Added `removePlayElement` to handle removing upon unmounting or removal of an element from the DOM to clear up the state.
41
-
42
- ## 2.0.4 - 2023-09-07
43
-
44
- - added @playhtml/react library
45
- - added `firstSetup` export from playhtml for raising error if it hasn't been initialized.
46
- - cleaned up exports
47
-
48
- ## 2.0.2 - 2023-08-23
49
-
50
- - handle deprecated import version by using a timeout. This adds a significant delay to the initialization of any client using the old method and logs a warning.
51
-
52
- ## 2.0.0 - 2023-08-23
53
-
54
- - **BREAKING CHANGE**: Changed the initializing of playhtml to be an explicit call of `playhtml.init()` from just a normal import. You can still use the old code if you pin the import to any version 1.3.1 (e.g. use `https://unpkg.com/playhtml@1.3.1` as the import source).
55
-
56
- **OLD CODE:**
57
-
58
- ```html
59
- <script type="module" src="https://unpkg.com/playhtml"></script>
60
- <link rel="stylesheet" href="https://unpkg.com/playhtml/dist/style.css" />
61
- ```
62
-
63
- **NEW CODE:**
64
-
65
- ```html
66
- <script type="module">
67
- import "https://unpkg.com/playhtml";
68
- playhtml.init();
69
- // Optionally you could call
70
- // playhtml.init({
71
- // room: window.location.pathname,
72
- // host: "mypartykit.user.partykit.dev"
73
- // })
74
- </script>
75
- <link rel="stylesheet" href="https://unpkg.com/playhtml/dist/style.css" />
76
- ```
77
-
78
- This change allows for more flexible use of the package, including specifying a partykit host and room.
79
-
80
- - was accidentally importing all my files for the website into the package, blowing it up to 4MB. I've fixed this and compressed down the `.d.ts` types file to just what is needed, so the package is down to 360KB. It should load much faster on websites now :)
81
-
82
- ## 1.3.1 - 2023-08-09
83
-
84
- - Removed unused code and consolidated types in `types.ts`
85
-
86
- ## 1.3.0 - 2023-08-07
87
-
88
- - Added support for `can-duplicate` capability to duplicate elements. Make factories for playhtml elements!!
89
-
90
- ## 1.2.0 - 2023-08-03
91
-
92
- - Added support for yjs's `awareness` protocol to handle synced data that shouldn't be persisted.