@knot-technologies/seatmap 0.3.1-dev.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/LICENSE +21 -0
- package/README.md +132 -0
- package/dist/index.cjs +1120 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.mjs +1103 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KNOT Technologies
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# @knot-technologies/seatmap
|
|
2
|
+
|
|
3
|
+
Framework-agnostic JavaScript SDK for embedding the KNOT Seatmap iframe engine.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @knot-technologies/seatmap
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Before the first production release, shared-dev integrations install the
|
|
12
|
+
prerelease channel explicitly:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @knot-technologies/seatmap@dev
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { mountSeatmap } from '@knot-technologies/seatmap';
|
|
22
|
+
|
|
23
|
+
const container = document.getElementById('seatmap');
|
|
24
|
+
|
|
25
|
+
if (!container) {
|
|
26
|
+
throw new Error('Missing seatmap container');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const chart = await mountSeatmap(container, {
|
|
30
|
+
session: 'sess_xxx',
|
|
31
|
+
token: 'jwt_xxx',
|
|
32
|
+
hold: 'seatmap',
|
|
33
|
+
onSelectionChanged(change) {
|
|
34
|
+
console.log(change.objects);
|
|
35
|
+
},
|
|
36
|
+
onChartRenderingFailed(error) {
|
|
37
|
+
console.error(error);
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
await chart.selectObjects(['A-1']);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The `session` and `token` fields are required for the standard booking flow. The token must be minted by the KNOT API for the target session and browser origin. The SDK uses KNOT-managed API and live-update endpoints internally; integrator applications do not configure backend or SSE URLs.
|
|
45
|
+
|
|
46
|
+
### Environment profiles
|
|
47
|
+
|
|
48
|
+
`production` is the default for stable releases. Integrations exercising the
|
|
49
|
+
shared Seatmap dev deployment select `development` explicitly:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
await mountSeatmap(container, {
|
|
53
|
+
session: 'sess_xxx',
|
|
54
|
+
token: 'jwt_xxx',
|
|
55
|
+
environment: 'development',
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`development` has its own release-controlled API, SSE, and engine origins; it
|
|
60
|
+
does not alias `predev` or `production`. Unknown or unconfigured profiles reject
|
|
61
|
+
before network or iframe work. Profiles never accept raw API, SSE, engine, or
|
|
62
|
+
CDN URL overrides from integrator code.
|
|
63
|
+
|
|
64
|
+
## Config
|
|
65
|
+
|
|
66
|
+
`mountSeatmap` accepts `SeatmapConfig` from `@knot-technologies/seatmap-types`.
|
|
67
|
+
|
|
68
|
+
Common options:
|
|
69
|
+
|
|
70
|
+
- `pricing`: category, object, and ticket-type pricing.
|
|
71
|
+
- `environment`: `production`, `predev`, or `development`.
|
|
72
|
+
- `hold`: `seatmap`, `external`, or `none`.
|
|
73
|
+
- `fitTo`: `width` for auto-height or `widthAndHeight` for fixed container height.
|
|
74
|
+
- `objectColor` and `tooltipText`: function hooks evaluated by the engine.
|
|
75
|
+
- Callback fields such as `onChartRendered`, `onObjectSelected`, `onSelectionChanged`, `onHoldSucceeded`, and `onHoldFailed`.
|
|
76
|
+
|
|
77
|
+
Integrations that own their reservation lifecycle can disable SDK-managed holds:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
hold: 'external';
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Chart API
|
|
84
|
+
|
|
85
|
+
The resolved `SeatmapChart` exposes selection, view, metadata, category, hold, and styling methods:
|
|
86
|
+
|
|
87
|
+
- `selectObjects`, `deselectObjects`, `clearSelection`, `listSelectedObjects`
|
|
88
|
+
- `highlightObjects`, `clearHighlights`, `pulse`, `unpulse`, `spotlight`, `clearSpotlight`
|
|
89
|
+
- `disableObjects`, `enableObjects`
|
|
90
|
+
- `setMetadata`, `setCategoryMetadata`
|
|
91
|
+
- `selectCategories`, `deselectCategories`, `listCategories`
|
|
92
|
+
- `findObject`
|
|
93
|
+
- `holdBestAvailable`
|
|
94
|
+
- `resetView`, `zoomToObjects`, `zoomToSelectedObjects`, `zoomToSection`
|
|
95
|
+
- `changeConfig`
|
|
96
|
+
- `destroy`
|
|
97
|
+
|
|
98
|
+
### View semantics
|
|
99
|
+
|
|
100
|
+
`resetView()` returns to **Fit**, which is always reported as `100%` regardless of the chart's world-space dimensions. Zoom values are normalized relative to that Fit transform; they are not raw renderer scales.
|
|
101
|
+
|
|
102
|
+
Buyer interaction authority is binary: `overview` or `seat`. `zoomToSection()` fits the camera to contextual geometry without creating a public section mode, focus toggle, or back-stack entry; `zoomToObjects()` and `zoomToSelectedObjects()` follow the same continuous-camera model. Programmatic navigation cancels residual pan momentum before moving. Small layouts may begin with seat authority at Fit when their projected seats are already actionable.
|
|
103
|
+
|
|
104
|
+
Rendered seats stop growing at a `30px` representative target with a `32px` hard ceiling for the largest seat. The read-only minimap appears as an orientation aid at seat authority, mirrors the live viewport, and never intercepts pointer input.
|
|
105
|
+
|
|
106
|
+
### Browser requirements
|
|
107
|
+
|
|
108
|
+
The booking map requires WebGL2. There is no Canvas, SVG, or compatibility renderer flag. A temporary context loss pauses drawing and picking while the complete GPU runtime is restored; camera, selection, and availability state remain in CPU memory. If WebGL2 is unavailable or restoration is exhausted, the iframe shows the seatmap-unavailable state instead of switching renderers. Integrations should always provide `onChartRenderingFailed` for chart-level bootstrap and rendering errors.
|
|
109
|
+
|
|
110
|
+
## Engine source
|
|
111
|
+
|
|
112
|
+
Published builds load the matching verified engine from the CDN assigned to the
|
|
113
|
+
selected environment. Stable versions use a `major.minor` channel. Prereleases
|
|
114
|
+
use an isolated channel such as `dev/0.3.1-dev.0`, so dev validation cannot move
|
|
115
|
+
the stable engine pointer. The origins are fixed at publication time and cannot
|
|
116
|
+
be overridden by consumer configuration.
|
|
117
|
+
|
|
118
|
+
## Types
|
|
119
|
+
|
|
120
|
+
This package re-exports the public types from `@knot-technologies/seatmap-types`.
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
import type { SeatmapChart, SeatmapConfig } from '@knot-technologies/seatmap';
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Versioning
|
|
127
|
+
|
|
128
|
+
Semver. Major = breaking public API. Minor = added features. Patch = fixes.
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
MIT
|