playhtml 2.1.12 → 2.2.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/style.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.__playhtml-can-move{cursor:grab;transition:transform .15s;will-change:transform}.__playhtml-can-move.cursordown{cursor:grabbing}.__playhtml-can-spin{cursor:grab;transition:transform .25s;will-change:transform}.__playhtml-can-spin.cursordown{cursor:grabbing}.__playhtml-can-grow{cursor:pointer;transition:transform .25s;will-change:transform}.__playhtml-can-toggle,.__playhtml-can-draw{cursor:pointer}.__playhtml-can-draw .__playhtml-draw-container{position:relative;width:100%;height:100%;cursor:none}.__playhtml-can-draw .__playhtml-draw-container canvas{position:absolute;top:0;left:0;cursor:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewport='0 0 100 100' style='overflow: visible; fill:black;font-size:20px;'><text y='-30%' x='-50%' style='transform:rotate(180deg)'>🖍️</text></svg>") 16 0,auto}body .__playhtml-element.editing:nth-child(2n){animation-name:jiggle1;animation-iteration-count:infinite;transform-origin:50% 10%;animation-duration:.25s;animation-delay:var(--jiggle-delay)}body .__playhtml-element.editing:nth-child(2n-1){animation-name:jiggle2;animation-iteration-count:infinite;animation-direction:alternate;transform-origin:30% 5%;animation-duration:.45s;animation-delay:var(--jiggle-delay)}@keyframes jiggle1{0%{transform:rotate(-1deg);animation-timing-function:ease-in}50%{transform:rotate(1.5deg);animation-timing-function:ease-out}}@keyframes jiggle2{0%{transform:rotate(1deg);animation-timing-function:ease-in}50%{transform:rotate(-1.5deg);animation-timing-function:ease-out}}
1
+ [can-move]{cursor:grab;transition:transform .15s;will-change:transform}[can-move].cursordown{cursor:grabbing}[can-spin]{cursor:grab;transition:transform .25s;will-change:transform}[can-spin].cursordown{cursor:grabbing}[can-grow]{cursor:pointer;transition:transform .25s;will-change:transform}[can-toggle]{cursor:pointer}body .__playhtml-element.editing:nth-child(2n){animation-name:jiggle1;animation-iteration-count:infinite;transform-origin:50% 10%;animation-duration:.25s;animation-delay:var(--jiggle-delay)}body .__playhtml-element.editing:nth-child(2n-1){animation-name:jiggle2;animation-iteration-count:infinite;animation-direction:alternate;transform-origin:30% 5%;animation-duration:.45s;animation-delay:var(--jiggle-delay)}@keyframes jiggle1{0%{transform:rotate(-1deg);animation-timing-function:ease-in}50%{transform:rotate(1.5deg);animation-timing-function:ease-out}}@keyframes jiggle2{0%{transform:rotate(1deg);animation-timing-function:ease-in}50%{transform:rotate(-1.5deg);animation-timing-function:ease-out}}.playhtml-loading{pointer-events:none}.playhtml-loading[data-loading-behavior=hidden]{opacity:0;visibility:hidden}.playhtml-loading[data-loading-style=breathing],.playhtml-loading[can-move],.playhtml-loading[can-toggle],.playhtml-loading[can-spin],.playhtml-loading[can-grow],.playhtml-loading[can-duplicate],.playhtml-loading[can-mirror],.playhtml-loading[can-draw],.playhtml-loading [loading-behavior=animate].playhtml-loading{animation:playhtml-breathing 2s infinite ease-in-out}.playhtml-loading[loading-style=fade]{opacity:.4!important;animation:none!important;transform:none!important}.playhtml-loading[loading-style=none],.playhtml-loading[loading-behavior=none]{opacity:1!important;animation:none!important;transform:none!important;visibility:visible!important;pointer-events:auto!important}@keyframes playhtml-breathing{0%,to{opacity:.7;transform:scale(1)}50%{opacity:.4;transform:scale(1.01)}}@keyframes playhtml-pulse{0%,to{opacity:.7;transform:scale(1)}50%{opacity:.3;transform:scale(1)}}
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",
5
+ "version": "2.2.1",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "keywords": [
@@ -48,18 +48,28 @@
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)",
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",
53
60
  "cleanup": "rm README.md && ln -s ../../README.md ."
54
61
  },
55
62
  "devDependencies": {
56
63
  "sass": "^1.62.1",
57
64
  "typescript": "^5.0.2",
58
65
  "vite": "^4.3.9",
59
- "vite-plugin-dts": "^3.0.3"
66
+ "vite-plugin-dts": "^3.0.3",
67
+ "vitest": "^3.1.1",
68
+ "jsdom": "^26.1.0"
60
69
  },
61
70
  "dependencies": {
62
- "@playhtml/common": "0.0.14",
71
+ "@playhtml/common": "0.1.0",
72
+ "@syncedstore/core": "^0.6.0",
63
73
  "y-indexeddb": "^9.0.11",
64
74
  "y-partykit": "^0.0.31",
65
75
  "yjs": "13.6.18"
package/CHANGELOG.md DELETED
@@ -1,88 +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.6 - 2024-04-17
6
-
7
- - fix bug with native image dragging conflicting with playhtml draggable elements.
8
-
9
- ## 2.1.2 - 2024-01-30
10
-
11
- - align dependencies
12
-
13
- ## 2.1.1 - 2024-01-30
14
-
15
- - 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.
16
-
17
- ## 2.1.0 - 2024-01-27
18
-
19
- - **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.
20
- - **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.
21
-
22
- ## 2.0.16 - 2024-01-04
23
-
24
- - **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.
25
- - **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.
26
- - exported `setupPlayElements` to call to look for any new elements to initialize
27
-
28
- ## 2.0.7 - 2023-10-02
29
-
30
- - upgrading y-partykit and yjs to latest for improved performance
31
-
32
- ## 2.0.5 - 2023-09-11
33
-
34
- - fixed an error with setting up elements before the provider was synced which lead to incorrect initial element states that didn't sync.
35
- - Removed the `firstSetup` export accordingly to allow for optimistically setting up elements even before `playhtml` is initialized.
36
- - Added `removePlayElement` to handle removing upon unmounting or removal of an element from the DOM to clear up the state.
37
-
38
- ## 2.0.4 - 2023-09-07
39
-
40
- - added @playhtml/react library
41
- - added `firstSetup` export from playhtml for raising error if it hasn't been initialized.
42
- - cleaned up exports
43
-
44
- ## 2.0.2 - 2023-08-23
45
-
46
- - 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.
47
-
48
- ## 2.0.0 - 2023-08-23
49
-
50
- - **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).
51
-
52
- **OLD CODE:**
53
-
54
- ```html
55
- <script type="module" src="https://unpkg.com/playhtml"></script>
56
- <link rel="stylesheet" href="https://unpkg.com/playhtml/dist/style.css" />
57
- ```
58
-
59
- **NEW CODE:**
60
-
61
- ```html
62
- <script type="module">
63
- import "https://unpkg.com/playhtml";
64
- playhtml.init();
65
- // Optionally you could call
66
- // playhtml.init({
67
- // room: window.location.pathname,
68
- // host: "mypartykit.user.partykit.dev"
69
- // })
70
- </script>
71
- <link rel="stylesheet" href="https://unpkg.com/playhtml/dist/style.css" />
72
- ```
73
-
74
- This change allows for more flexible use of the package, including specifying a partykit host and room.
75
-
76
- - 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 :)
77
-
78
- ## 1.3.1 - 2023-08-09
79
-
80
- - Removed unused code and consolidated types in `types.ts`
81
-
82
- ## 1.3.0 - 2023-08-07
83
-
84
- - Added support for `can-duplicate` capability to duplicate elements. Make factories for playhtml elements!!
85
-
86
- ## 1.2.0 - 2023-08-03
87
-
88
- - Added support for yjs's `awareness` protocol to handle synced data that shouldn't be persisted.