@tinyweb_dev/oe-exam-sdk 0.1.16 → 0.1.17

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.
@@ -14,9 +14,14 @@ export declare const ENGLISH_CERT_STICKY_AUDIO_ATTR = "data-ec-sticky-audio";
14
14
  /** Nearest ancestor that actually scrolls (falls back to document scrolling element). */
15
15
  export declare function findScrollableParent(el: HTMLElement): HTMLElement;
16
16
  /**
17
- * Scroll `el` into view inside its nearest scrollable ancestor.
18
- * Prefer parent-relative scroll so nested columns (Reading split-view) work.
19
- * When a sticky Listening audio bar is present, leave room under it.
17
+ * Find all scrollable ancestors of `el` up to the root scroll container.
18
+ * Returns array ordered from innermost parent to outermost parent.
19
+ */
20
+ export declare function findAllScrollableParents(el: HTMLElement): HTMLElement[];
21
+ /**
22
+ * Scroll `el` into view across all its nested scrollable ancestors.
23
+ * Handles split-view columns (Reading Part 7 / Articles), parent document wrappers,
24
+ * main scroll area, and sticky Listening audio bar clearance.
20
25
  */
21
26
  export declare function scrollElementIntoView(el: HTMLElement, options?: {
22
27
  behavior?: ScrollBehavior;
@@ -1 +1 @@
1
- export function englishCertQuestionDomId(t){return`ec-question-${t}`}export const ENGLISH_CERT_STICKY_AUDIO_ATTR="data-ec-sticky-audio";const t=[0,50,120,250,400];function e(t){const e=window.getComputedStyle(t).overflowY;return("auto"===e||"scroll"===e||"overlay"===e)&&t.scrollHeight>t.clientHeight+1}export function findScrollableParent(t){let n=t.parentElement;for(;n;){if(e(n))return n;n=n.parentElement}return document.scrollingElement??document.documentElement}export function scrollElementIntoView(t,e){const n=e?.behavior??"smooth",o=e?.block??"start",i=findScrollableParent(t),l=function(t,e){const n=t.querySelectorAll("[data-ec-sticky-audio]");if(!n.length)return 0;let o=0;return n.forEach(n=>{if(n===e||n.contains(e))return;if(!t.contains(n))return;const i=n.getBoundingClientRect().height;i>o&&(o=i)}),o>0?o+12:0}(i,t),r=i.getBoundingClientRect(),c=t.getBoundingClientRect(),s=i.scrollTop,u=c.top-r.top+s;let a=u;if("center"===o)a=u-i.clientHeight/2+c.height/2;else if("end"===o)a=u-i.clientHeight+c.height;else if("nearest"===o){const t=s+l,e=s+i.clientHeight,n=u+c.height;if(u>=t&&n<=e)return;a=u<t?u-l:n-i.clientHeight}else a=u-l;"start"===o&&0===l&&(a=Math.max(0,a-12)),i.scrollTo({top:Math.max(0,a),behavior:n})}export function scrollToEnglishCertQuestion(e,n){if("undefined"==typeof document||!e)return;const o=englishCertQuestionDomId(e);let i=0;const l=()=>{const e=document.getElementById(o);e?scrollElementIntoView(e,n):(i+=1,i<t.length&&window.setTimeout(l,t[i]))};window.setTimeout(l,t[0])}
1
+ export function englishCertQuestionDomId(t){return`ec-question-${t}`}export const ENGLISH_CERT_STICKY_AUDIO_ATTR="data-ec-sticky-audio";const t=[0,30,80,150,300,500,800];function e(t){const e=window.getComputedStyle(t).overflowY;return("auto"===e||"scroll"===e||"overlay"===e)&&t.scrollHeight>t.clientHeight+1}export function findScrollableParent(t){let n=t.parentElement;for(;n;){if(e(n))return n;n=n.parentElement}return document.scrollingElement??document.documentElement}export function findAllScrollableParents(t){const n=[];let o=t.parentElement;for(;o;)e(o)&&n.push(o),o=o.parentElement;const l=document.scrollingElement??document.documentElement;return l&&!n.includes(l)&&l.scrollHeight>l.clientHeight+1&&n.push(l),n.length?n:[l]}export function scrollElementIntoView(t,e){const n=e?.behavior??"smooth",o=e?.block??"start",l=findAllScrollableParents(t);if(!l.length)return;l.map(e=>{const n=e.getBoundingClientRect(),l=t.getBoundingClientRect(),r=e.scrollTop,i=l.top-n.top+r,c=function(t,e){const n=t.querySelectorAll("[data-ec-sticky-audio]");if(!n.length)return 0;let o=0;return n.forEach(n=>{if(n===e||n.contains(e))return;if(!t.contains(n))return;const l=n.getBoundingClientRect().height;l>o&&(o=l)}),o>0?o+12:0}(e,t);let s=i;if("center"===o)s=i-e.clientHeight/2+l.height/2;else if("end"===o)s=i-e.clientHeight+l.height;else if("nearest"===o){const t=r+c,n=r+e.clientHeight,o=i+l.height;s=i>=t&&o<=n?r:i<t?i-c:o-e.clientHeight}else s=i-c;return"start"===o&&0===c&&(s=Math.max(0,s-12)),{parent:e,targetTop:Math.max(0,s)}}).forEach(({parent:t,targetTop:e})=>{t.scrollTo({top:e,behavior:n})})}export function scrollToEnglishCertQuestion(e,n){if("undefined"==typeof document||!e)return;const o=englishCertQuestionDomId(e),l=()=>{const t=document.getElementById(o);return!!t&&(scrollElementIntoView(t,n),!0)};if(l())return;let r=1;const i=()=>{l()||(r+=1,r<t.length&&window.setTimeout(i,t[r]))};window.setTimeout(i,t[1])}
@@ -25,6 +25,7 @@ export interface AuditUser {
25
25
  export interface Branch extends BaseEntity {
26
26
  code: string;
27
27
  name: string;
28
+ shortName?: string | null;
28
29
  address?: string | null;
29
30
  phone?: string | null;
30
31
  email?: string | null;
@@ -90,6 +91,7 @@ export interface BranchTeacher {
90
91
  export interface CreateBranchDto {
91
92
  code: string;
92
93
  name: string;
94
+ shortName?: string;
93
95
  address?: string;
94
96
  phone?: string;
95
97
  email?: string;
@@ -106,6 +108,7 @@ export interface CreateBranchDto {
106
108
  export interface UpdateBranchDto {
107
109
  code?: string;
108
110
  name?: string;
111
+ shortName?: string;
109
112
  address?: string;
110
113
  phone?: string;
111
114
  email?: string;
package/package.json CHANGED
@@ -1,163 +1,163 @@
1
- {
2
- "name": "@tinyweb_dev/oe-exam-sdk",
3
- "version": "0.1.16",
4
- "description": "Reusable OceanEdu question components.",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "bin": {
10
- "oe-exam-mcp": "./dist/mcp/index.js"
11
- },
12
- "files": [
13
- "dist",
14
- "README.md"
15
- ],
16
- "sideEffects": [
17
- "**/*.css"
18
- ],
19
- "scripts": {
20
- "clean": "rm -rf dist",
21
- "build:compile": "tsc -p tsconfig.build.json",
22
- "build:alias": "tsc-alias -p tsconfig.build.json",
23
- "build:ts": "npm run build:compile && npm run build:assets && npm run build:alias",
24
- "build:assets": "for d in cambridge-yle english-certification summer-sky; do [ -d src/components/themes/$d/assets ] && cp -R src/components/themes/$d/assets dist/components/themes/$d/ || true; done; [ -d src/components/shared/audio/assets ] && cp -R src/components/shared/audio/assets dist/components/shared/audio/ || true; [ -d src/components/results/report/assets ] && mkdir -p dist/components/results/report && cp -R src/components/results/report/assets dist/components/results/report/ || true; (cd src && find . -name '*.module.css' -exec cp --parents {} ../dist/ \\;); cp src/global.d.ts dist/global.d.ts",
25
- "minify:js": "find dist -name '*.js' -type f -exec sh -c 'for f do terser \"$f\" --compress directives=false --mangle --module --comments false --output \"$f\"; done' sh {} +",
26
- "build": "npm run clean && npm run build:ts && npm run minify:js",
27
- "pack:local": "npm pack",
28
- "release": "npm run release:patch",
29
- "release:patch": "npm version patch --no-git-tag-version && npm run release:push",
30
- "release:minor": "npm version minor --no-git-tag-version && npm run release:push",
31
- "release:major": "npm version major --no-git-tag-version && npm run release:push",
32
- "release:push": "npm run build && npm pack --dry-run && VERSION=$(node -p \"require('./package.json').version\") && git add package.json package-lock.json && git commit -m \"chore(sdk): release v$VERSION\" && git tag \"sdk-v$VERSION\" && git push origin HEAD && git push origin \"sdk-v$VERSION\"",
33
- "prepack": "npm run build"
34
- },
35
- "exports": {
36
- ".": {
37
- "types": "./dist/index.d.ts",
38
- "import": "./dist/index.js"
39
- },
40
- "./api": {
41
- "types": "./dist/api/index.d.ts",
42
- "import": "./dist/api/index.js"
43
- },
44
- "./components": {
45
- "types": "./dist/components/index.d.ts",
46
- "import": "./dist/components/index.js"
47
- },
48
- "./mcp": {
49
- "types": "./dist/mcp/index.d.ts",
50
- "import": "./dist/mcp/index.js"
51
- },
52
- "./components/exams": {
53
- "types": "./dist/components/exams/index.d.ts",
54
- "import": "./dist/components/exams/index.js"
55
- },
56
- "./components/exams/take": {
57
- "types": "./dist/components/exams/take/index.d.ts",
58
- "import": "./dist/components/exams/take/index.js"
59
- },
60
- "./components/exams/entry": {
61
- "types": "./dist/components/exams/entry/index.d.ts",
62
- "import": "./dist/components/exams/entry/index.js"
63
- },
64
- "./components/exams/rooms": {
65
- "types": "./dist/components/exams/rooms/index.d.ts",
66
- "import": "./dist/components/exams/rooms/index.js"
67
- },
68
- "./components/questions": {
69
- "types": "./dist/components/questions/index.d.ts",
70
- "import": "./dist/components/questions/index.js"
71
- },
72
- "./components/themes": {
73
- "types": "./dist/components/themes/index.d.ts",
74
- "import": "./dist/components/themes/index.js"
75
- },
76
- "./components/results": {
77
- "types": "./dist/components/results/index.d.ts",
78
- "import": "./dist/components/results/index.js"
79
- },
80
- "./components/questions/*": {
81
- "types": "./dist/components/questions/*.d.ts",
82
- "import": "./dist/components/questions/*.js"
83
- },
84
- "./shared": {
85
- "types": "./dist/shared/index.d.ts",
86
- "import": "./dist/shared/index.js"
87
- },
88
- "./*": {
89
- "types": "./dist/components/questions/*.d.ts",
90
- "import": "./dist/components/questions/*.js"
91
- },
92
- "./package.json": "./package.json"
93
- },
94
- "publishConfig": {
95
- "access": "public"
96
- },
97
- "peerDependencies": {
98
- "next": ">=15",
99
- "react": ">=19",
100
- "react-dom": ">=19"
101
- },
102
- "devDependencies": {
103
- "@types/node": "^25.9.3",
104
- "terser": "^5.48.0",
105
- "tsc-alias": "^1.8.17",
106
- "typescript": "~5.9.2"
107
- },
108
- "dependencies": {
109
- "@dnd-kit/core": "^6.3.1",
110
- "@dnd-kit/sortable": "^10.0.0",
111
- "@dnd-kit/utilities": "^3.2.2",
112
- "@fortawesome/free-solid-svg-icons": "^7.3.1",
113
- "@fortawesome/react-fontawesome": "^3.3.1",
114
- "@hookform/resolvers": "^5.2.2",
115
- "@modelcontextprotocol/sdk": "^1.29.0",
116
- "@radix-ui/react-alert-dialog": "^1.1.15",
117
- "@radix-ui/react-avatar": "^1.1.10",
118
- "@radix-ui/react-checkbox": "^1.3.3",
119
- "@radix-ui/react-collapsible": "^1.1.12",
120
- "@radix-ui/react-dialog": "^1.1.15",
121
- "@radix-ui/react-dropdown-menu": "^2.1.16",
122
- "@radix-ui/react-hover-card": "^1.1.15",
123
- "@radix-ui/react-label": "^2.1.7",
124
- "@radix-ui/react-popover": "^1.1.15",
125
- "@radix-ui/react-progress": "^1.1.7",
126
- "@radix-ui/react-radio-group": "^1.3.8",
127
- "@radix-ui/react-scroll-area": "^1.2.10",
128
- "@radix-ui/react-select": "^2.2.6",
129
- "@radix-ui/react-separator": "^1.1.7",
130
- "@radix-ui/react-slot": "^1.2.3",
131
- "@radix-ui/react-switch": "^1.2.6",
132
- "@radix-ui/react-tabs": "^1.1.13",
133
- "@radix-ui/react-tooltip": "^1.2.8",
134
- "@tanstack/react-query": "^5.90.2",
135
- "@tiptap/extension-table": "^3.22.3",
136
- "@tiptap/extension-table-cell": "^3.22.3",
137
- "@tiptap/extension-table-header": "^3.22.3",
138
- "@tiptap/extension-table-row": "^3.22.3",
139
- "@tiptap/extension-text-align": "^3.22.3",
140
- "@tiptap/pm": "^3.22.3",
141
- "@tiptap/react": "^3.22.3",
142
- "@tiptap/starter-kit": "^3.22.3",
143
- "@types/qrcode": "^1.5.6",
144
- "@xyflow/react": "^12.8.6",
145
- "axios": "^1.12.2",
146
- "class-variance-authority": "^0.7.1",
147
- "clsx": "^2.1.1",
148
- "cmdk": "^1.1.1",
149
- "date-fns": "^4.1.0",
150
- "embla-carousel-react": "^8.6.0",
151
- "howler": "^2.2.4",
152
- "lucide-react": "^0.544.0",
153
- "qrcode": "^1.5.4",
154
- "radix-ui": "^1.4.3",
155
- "react-day-picker": "^9.14.0",
156
- "react-hook-form": "^7.65.0",
157
- "sonner": "^2.0.7",
158
- "tailwind-merge": "^3.3.1",
159
- "vaul": "^1.1.2",
160
- "zod": "^4.1.11",
161
- "zustand": "^5.0.8"
162
- }
163
- }
1
+ {
2
+ "name": "@tinyweb_dev/oe-exam-sdk",
3
+ "version": "0.1.17",
4
+ "description": "Reusable OceanEdu question components.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "bin": {
10
+ "oe-exam-mcp": "./dist/mcp/index.js"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "README.md"
15
+ ],
16
+ "sideEffects": [
17
+ "**/*.css"
18
+ ],
19
+ "scripts": {
20
+ "clean": "rm -rf dist",
21
+ "build:compile": "tsc -p tsconfig.build.json",
22
+ "build:alias": "tsc-alias -p tsconfig.build.json",
23
+ "build:ts": "npm run build:compile && npm run build:assets && npm run build:alias",
24
+ "build:assets": "for d in cambridge-yle english-certification summer-sky; do [ -d src/components/themes/$d/assets ] && cp -R src/components/themes/$d/assets dist/components/themes/$d/ || true; done; [ -d src/components/shared/audio/assets ] && cp -R src/components/shared/audio/assets dist/components/shared/audio/ || true; [ -d src/components/results/report/assets ] && mkdir -p dist/components/results/report && cp -R src/components/results/report/assets dist/components/results/report/ || true; (cd src && find . -name '*.module.css' -exec cp --parents {} ../dist/ \\;); cp src/global.d.ts dist/global.d.ts",
25
+ "minify:js": "find dist -name '*.js' -type f -exec sh -c 'for f do terser \"$f\" --compress directives=false --mangle --module --comments false --output \"$f\"; done' sh {} +",
26
+ "build": "npm run clean && npm run build:ts && npm run minify:js",
27
+ "pack:local": "npm pack",
28
+ "release": "npm run release:patch",
29
+ "release:patch": "npm version patch --no-git-tag-version && npm run release:push",
30
+ "release:minor": "npm version minor --no-git-tag-version && npm run release:push",
31
+ "release:major": "npm version major --no-git-tag-version && npm run release:push",
32
+ "release:push": "npm run build && npm pack --dry-run && VERSION=$(node -p \"require('./package.json').version\") && git add package.json package-lock.json && git commit -m \"chore(sdk): release v$VERSION\" && git tag \"sdk-v$VERSION\" && git push origin HEAD && git push origin \"sdk-v$VERSION\"",
33
+ "prepack": "npm run build"
34
+ },
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/index.d.ts",
38
+ "import": "./dist/index.js"
39
+ },
40
+ "./api": {
41
+ "types": "./dist/api/index.d.ts",
42
+ "import": "./dist/api/index.js"
43
+ },
44
+ "./components": {
45
+ "types": "./dist/components/index.d.ts",
46
+ "import": "./dist/components/index.js"
47
+ },
48
+ "./mcp": {
49
+ "types": "./dist/mcp/index.d.ts",
50
+ "import": "./dist/mcp/index.js"
51
+ },
52
+ "./components/exams": {
53
+ "types": "./dist/components/exams/index.d.ts",
54
+ "import": "./dist/components/exams/index.js"
55
+ },
56
+ "./components/exams/take": {
57
+ "types": "./dist/components/exams/take/index.d.ts",
58
+ "import": "./dist/components/exams/take/index.js"
59
+ },
60
+ "./components/exams/entry": {
61
+ "types": "./dist/components/exams/entry/index.d.ts",
62
+ "import": "./dist/components/exams/entry/index.js"
63
+ },
64
+ "./components/exams/rooms": {
65
+ "types": "./dist/components/exams/rooms/index.d.ts",
66
+ "import": "./dist/components/exams/rooms/index.js"
67
+ },
68
+ "./components/questions": {
69
+ "types": "./dist/components/questions/index.d.ts",
70
+ "import": "./dist/components/questions/index.js"
71
+ },
72
+ "./components/themes": {
73
+ "types": "./dist/components/themes/index.d.ts",
74
+ "import": "./dist/components/themes/index.js"
75
+ },
76
+ "./components/results": {
77
+ "types": "./dist/components/results/index.d.ts",
78
+ "import": "./dist/components/results/index.js"
79
+ },
80
+ "./components/questions/*": {
81
+ "types": "./dist/components/questions/*.d.ts",
82
+ "import": "./dist/components/questions/*.js"
83
+ },
84
+ "./shared": {
85
+ "types": "./dist/shared/index.d.ts",
86
+ "import": "./dist/shared/index.js"
87
+ },
88
+ "./*": {
89
+ "types": "./dist/components/questions/*.d.ts",
90
+ "import": "./dist/components/questions/*.js"
91
+ },
92
+ "./package.json": "./package.json"
93
+ },
94
+ "publishConfig": {
95
+ "access": "public"
96
+ },
97
+ "peerDependencies": {
98
+ "next": ">=15",
99
+ "react": ">=19",
100
+ "react-dom": ">=19"
101
+ },
102
+ "devDependencies": {
103
+ "@types/node": "^25.9.3",
104
+ "terser": "^5.48.0",
105
+ "tsc-alias": "^1.8.17",
106
+ "typescript": "~5.9.2"
107
+ },
108
+ "dependencies": {
109
+ "@dnd-kit/core": "^6.3.1",
110
+ "@dnd-kit/sortable": "^10.0.0",
111
+ "@dnd-kit/utilities": "^3.2.2",
112
+ "@fortawesome/free-solid-svg-icons": "^7.3.1",
113
+ "@fortawesome/react-fontawesome": "^3.3.1",
114
+ "@hookform/resolvers": "^5.2.2",
115
+ "@modelcontextprotocol/sdk": "^1.29.0",
116
+ "@radix-ui/react-alert-dialog": "^1.1.15",
117
+ "@radix-ui/react-avatar": "^1.1.10",
118
+ "@radix-ui/react-checkbox": "^1.3.3",
119
+ "@radix-ui/react-collapsible": "^1.1.12",
120
+ "@radix-ui/react-dialog": "^1.1.15",
121
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
122
+ "@radix-ui/react-hover-card": "^1.1.15",
123
+ "@radix-ui/react-label": "^2.1.7",
124
+ "@radix-ui/react-popover": "^1.1.15",
125
+ "@radix-ui/react-progress": "^1.1.7",
126
+ "@radix-ui/react-radio-group": "^1.3.8",
127
+ "@radix-ui/react-scroll-area": "^1.2.10",
128
+ "@radix-ui/react-select": "^2.2.6",
129
+ "@radix-ui/react-separator": "^1.1.7",
130
+ "@radix-ui/react-slot": "^1.2.3",
131
+ "@radix-ui/react-switch": "^1.2.6",
132
+ "@radix-ui/react-tabs": "^1.1.13",
133
+ "@radix-ui/react-tooltip": "^1.2.8",
134
+ "@tanstack/react-query": "^5.90.2",
135
+ "@tiptap/extension-table": "^3.22.3",
136
+ "@tiptap/extension-table-cell": "^3.22.3",
137
+ "@tiptap/extension-table-header": "^3.22.3",
138
+ "@tiptap/extension-table-row": "^3.22.3",
139
+ "@tiptap/extension-text-align": "^3.22.3",
140
+ "@tiptap/pm": "^3.22.3",
141
+ "@tiptap/react": "^3.22.3",
142
+ "@tiptap/starter-kit": "^3.22.3",
143
+ "@types/qrcode": "^1.5.6",
144
+ "@xyflow/react": "^12.8.6",
145
+ "axios": "^1.12.2",
146
+ "class-variance-authority": "^0.7.1",
147
+ "clsx": "^2.1.1",
148
+ "cmdk": "^1.1.1",
149
+ "date-fns": "^4.1.0",
150
+ "embla-carousel-react": "^8.6.0",
151
+ "howler": "^2.2.4",
152
+ "lucide-react": "^0.544.0",
153
+ "qrcode": "^1.5.4",
154
+ "radix-ui": "^1.4.3",
155
+ "react-day-picker": "^9.14.0",
156
+ "react-hook-form": "^7.65.0",
157
+ "sonner": "^2.0.7",
158
+ "tailwind-merge": "^3.3.1",
159
+ "vaul": "^1.1.2",
160
+ "zod": "^4.1.11",
161
+ "zustand": "^5.0.8"
162
+ }
163
+ }