@selfhelp/sh2-shp-survey-js-mobile 0.3.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/dist/index.d.mts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +641 -0
- package/dist/index.mjs +630 -0
- package/package.json +70 -0
- package/src/api/surveys.ts +205 -0
- package/src/bridge/messages.ts +264 -0
- package/src/css.d.ts +13 -0
- package/src/index.ts +57 -0
- package/src/runtime/controller.ts +166 -0
- package/src/runtime/lifecycle.ts +118 -0
- package/src/styles/SurveyJsStyle.tsx +347 -0
- package/src/styles/section.ts +131 -0
- package/src/styles/transport/SurveyWebViewNative.tsx +53 -0
- package/src/styles/transport/SurveyWebViewWeb.tsx +63 -0
- package/src/styles/transport/contract.ts +33 -0
- package/src/webview/generated/runtimeHtml.ts +26 -0
- package/src/webview/htmlAsset.ts +14 -0
- package/src/webview/index.html +20 -0
- package/src/webview/runtime/SurveyWebviewApp.tsx +183 -0
- package/src/webview/runtime/bridge.ts +76 -0
- package/src/webview/runtime/main.tsx +24 -0
- package/src/webview/runtime/runtime.css +27 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IMobilePluginRegistration } from '@selfhelp/shared/plugin-sdk';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `@selfhelp/sh2-shp-survey-js-mobile` — mobile entry.
|
|
5
|
+
*
|
|
6
|
+
* Bundled into mobile builds by the host's `plugins:sync` script
|
|
7
|
+
* (per EAS profile). Exports `registerMobile` which returns the
|
|
8
|
+
* plugin's `IMobilePluginRegistration` — the `surveyjs` style.
|
|
9
|
+
*
|
|
10
|
+
* The style (`styles/SurveyJsStyle`) is a thin native shell that hosts the
|
|
11
|
+
* OFFICIAL SurveyJS web runtime (`survey-core` + `survey-react-ui`) inside an
|
|
12
|
+
* isolated, self-contained WebView — `react-native-webview` on native, an
|
|
13
|
+
* `iframe` on the Expo web export — driven by a typed postMessage bridge.
|
|
14
|
+
* This gives mobile full parity with the web frontend (same JSON, question
|
|
15
|
+
* types, validation, conditional logic, completion, redirect). The native
|
|
16
|
+
* host owns ALL authenticated API calls via `@selfhelp/shared`
|
|
17
|
+
* `MobileHostServices`; the WebView never sees the access token.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
declare const PLUGIN_ID = "sh2-shp-survey-js";
|
|
21
|
+
/**
|
|
22
|
+
* Must match `plugin.json#version` and the mobile `package.json#version`.
|
|
23
|
+
* `PluginRuntime.registerOne()` (web) and the mobile sync script both
|
|
24
|
+
* compare these constants against the manifest version; a mismatch
|
|
25
|
+
* silently breaks the plugin.
|
|
26
|
+
*/
|
|
27
|
+
declare const PLUGIN_VERSION = "0.3.0";
|
|
28
|
+
declare const registerMobile: () => IMobilePluginRegistration;
|
|
29
|
+
|
|
30
|
+
export { PLUGIN_ID, PLUGIN_VERSION, registerMobile as default, registerMobile };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IMobilePluginRegistration } from '@selfhelp/shared/plugin-sdk';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `@selfhelp/sh2-shp-survey-js-mobile` — mobile entry.
|
|
5
|
+
*
|
|
6
|
+
* Bundled into mobile builds by the host's `plugins:sync` script
|
|
7
|
+
* (per EAS profile). Exports `registerMobile` which returns the
|
|
8
|
+
* plugin's `IMobilePluginRegistration` — the `surveyjs` style.
|
|
9
|
+
*
|
|
10
|
+
* The style (`styles/SurveyJsStyle`) is a thin native shell that hosts the
|
|
11
|
+
* OFFICIAL SurveyJS web runtime (`survey-core` + `survey-react-ui`) inside an
|
|
12
|
+
* isolated, self-contained WebView — `react-native-webview` on native, an
|
|
13
|
+
* `iframe` on the Expo web export — driven by a typed postMessage bridge.
|
|
14
|
+
* This gives mobile full parity with the web frontend (same JSON, question
|
|
15
|
+
* types, validation, conditional logic, completion, redirect). The native
|
|
16
|
+
* host owns ALL authenticated API calls via `@selfhelp/shared`
|
|
17
|
+
* `MobileHostServices`; the WebView never sees the access token.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
declare const PLUGIN_ID = "sh2-shp-survey-js";
|
|
21
|
+
/**
|
|
22
|
+
* Must match `plugin.json#version` and the mobile `package.json#version`.
|
|
23
|
+
* `PluginRuntime.registerOne()` (web) and the mobile sync script both
|
|
24
|
+
* compare these constants against the manifest version; a mismatch
|
|
25
|
+
* silently breaks the plugin.
|
|
26
|
+
*/
|
|
27
|
+
declare const PLUGIN_VERSION = "0.3.0";
|
|
28
|
+
declare const registerMobile: () => IMobilePluginRegistration;
|
|
29
|
+
|
|
30
|
+
export { PLUGIN_ID, PLUGIN_VERSION, registerMobile as default, registerMobile };
|