@awaitio/input-url 0.0.0-stage → 0.1.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 +64 -0
- package/README.md +37 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/inputUrl.d.ts +8 -0
- package/dist/inputUrl.d.ts.map +1 -0
- package/dist/inputUrl.js +40 -0
- package/dist/ui/ui.js +1 -0
- package/package.json +35 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# AwaitIO License
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Orukami s.r.o., Rybná 716/24, 110 00 Praha 1, Czech Republic, company ID 64049159, registered in the Commercial Register kept by the Municipal Court in Prague, section C, file 74046 (the "Licensor")
|
|
4
|
+
|
|
5
|
+
The source code of AwaitIO is public. Whether you can use it for free depends on how many people use it: small teams use AwaitIO for free, including commercially, while for-profit organizations with more users need a Company License. This keeps AwaitIO free for most people and funds its development.
|
|
6
|
+
|
|
7
|
+
This license covers everything in this repository, the package `awaitio` and every package published by the Licensor under the `@awaitio` scope on npm, now or in the future, such as `@awaitio/input-text`, `@awaitio/input-textarea` and `@awaitio/input-datetime` (together, "AwaitIO").
|
|
8
|
+
|
|
9
|
+
## Users
|
|
10
|
+
|
|
11
|
+
A "user" is a person who uses an application built with AwaitIO, whether it runs locally or is deployed: an employee, a contractor or anyone else who opens it, runs its actions or answers them. What counts is the number of real people, not the number of logins: several people sharing one login are several users. Count each person once across all of your organization's AwaitIO applications and environments.
|
|
12
|
+
|
|
13
|
+
## Free License
|
|
14
|
+
|
|
15
|
+
### Who is eligible
|
|
16
|
+
|
|
17
|
+
You may use AwaitIO for free if you are:
|
|
18
|
+
|
|
19
|
+
- an individual or a for-profit organization with up to 3 users;
|
|
20
|
+
- a non-profit or not-for-profit organization, or an educational institution; or
|
|
21
|
+
- evaluating whether AwaitIO fits your needs, and not yet using it commercially.
|
|
22
|
+
|
|
23
|
+
### What you may do
|
|
24
|
+
|
|
25
|
+
If you are eligible, you are granted permission, free of charge, to:
|
|
26
|
+
|
|
27
|
+
- use AwaitIO, commercially or not, including in production;
|
|
28
|
+
- build applications and internal tools with AwaitIO, for yourself and for your clients; and
|
|
29
|
+
- modify AwaitIO for your own use, or to contribute fixes and improvements back to AwaitIO.
|
|
30
|
+
|
|
31
|
+
## Company License
|
|
32
|
+
|
|
33
|
+
A for-profit organization with more than 3 users needs a Company License to use AwaitIO, priced by the number of users (see the pricing in the README). It allows the same use as the Free License. To get one, write to p.homoky@gmail.com.
|
|
34
|
+
|
|
35
|
+
Eligibility is decided by the organization that uses AwaitIO. If you build tools with AwaitIO for a client and the client runs them, the client's users count and the client needs a Company License unless it is eligible for the Free License itself.
|
|
36
|
+
|
|
37
|
+
## Same software, honor system
|
|
38
|
+
|
|
39
|
+
The Free License and the Company License cover exactly the same software. AwaitIO has no paid features, no license keys, no usage limits and no telemetry, and it never checks which license you have. The licensing works on trust: if your organization needs a Company License, get one.
|
|
40
|
+
|
|
41
|
+
## What nobody may do
|
|
42
|
+
|
|
43
|
+
Whatever your license, without a separate written agreement with the Licensor you may not:
|
|
44
|
+
|
|
45
|
+
1. copy or modify AwaitIO in order to sell, rent, license, relicense or sublicense AwaitIO itself or your own derivative or fork of it;
|
|
46
|
+
2. offer AwaitIO, or a derivative or fork of it, to third parties as a product or service that competes with AwaitIO;
|
|
47
|
+
3. offer to third parties a commercial hosted or managed service built on AwaitIO, such as a dashboard, cloud, monitoring or management service for applications that use AwaitIO; or
|
|
48
|
+
4. sell or license to third parties components, plugins or extensions made for AwaitIO.
|
|
49
|
+
|
|
50
|
+
Building applications with AwaitIO, running them and handing them over to your clients is none of the above.
|
|
51
|
+
|
|
52
|
+
## Changes to this license
|
|
53
|
+
|
|
54
|
+
The Licensor may change this license, including its prices and eligibility, at any time. A change applies to the versions of AwaitIO released after it; each version is governed by the license included with that version.
|
|
55
|
+
|
|
56
|
+
If you do not agree with the license of a newer version, you may keep using the versions you already have under the license they came with, but you may not upgrade to a version released under the license you do not agree with. Installing or using a newer version means you accept its license.
|
|
57
|
+
|
|
58
|
+
## Warranty
|
|
59
|
+
|
|
60
|
+
AwaitIO is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the Licensor or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with AwaitIO or the use of or other dealings in AwaitIO.
|
|
61
|
+
|
|
62
|
+
## Support
|
|
63
|
+
|
|
64
|
+
Support is provided on a best-effort basis through GitHub issues. Company License holders get priority.
|
package/README.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @awaitio/input-url
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
URL input for [AwaitIO](https://awaitio.com): `io.input.url()`, returns a URL.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @awaitio/input-url
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Needs `awaitio` and `zod` in the app, see the [quickstart](https://docs.awaitio.com/quickstart).
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
Register it under the key you want in `io`, see [Input components](https://docs.awaitio.com/core/input-components):
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { inputUrl } from '@awaitio/input-url';
|
|
21
|
+
|
|
22
|
+
export const app = new AwaitIO({
|
|
23
|
+
// name, actionsDirectory, theme, secret, users…
|
|
24
|
+
components: { input: { url: inputUrl } },
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
const website = await io.input.url('Website', {
|
|
32
|
+
placeholder: 'https://example.com',
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
website.hostname; // 'example.com'
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Props, optional, returns, built-in validation and custom validation are on the [Input URL docs page](https://docs.awaitio.com/io/input-url).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export declare const inputUrl: import("awaitio").ComponentDefinition<z.ZodObject<{
|
|
3
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
4
|
+
helpText: z.ZodOptional<z.ZodString>;
|
|
5
|
+
defaultValue: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>, z.ZodTransform<string, string | URL>>>;
|
|
6
|
+
allowedProtocols: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
7
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodString, z.ZodTransform<URL, string>>>;
|
|
8
|
+
//# sourceMappingURL=inputUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputUrl.d.ts","sourceRoot":"","sources":["../src/inputUrl.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,QAAQ;;;;;uEAiCnB,CAAC"}
|
package/dist/inputUrl.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inputUrl = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const awaitio_1 = require("awaitio");
|
|
6
|
+
const ui_1 = require("awaitio/ui");
|
|
7
|
+
const v4_1 = require("zod/v4");
|
|
8
|
+
exports.inputUrl = (0, awaitio_1.defineComponent)({
|
|
9
|
+
props: v4_1.z.object({
|
|
10
|
+
placeholder: v4_1.z.string().optional(),
|
|
11
|
+
helpText: v4_1.z.string().optional(),
|
|
12
|
+
// A URL from the handler travels as its text.
|
|
13
|
+
defaultValue: v4_1.z
|
|
14
|
+
.union([v4_1.z.string(), v4_1.z.instanceof(URL)])
|
|
15
|
+
.transform((value) => {
|
|
16
|
+
return value.toString();
|
|
17
|
+
})
|
|
18
|
+
.optional(),
|
|
19
|
+
// Schemes the address may use, without the colon: by default only web addresses.
|
|
20
|
+
allowedProtocols: v4_1.z.array(v4_1.z.string()).min(1).default(['http', 'https']),
|
|
21
|
+
}),
|
|
22
|
+
// The browser sends the text; the handler gets a URL.
|
|
23
|
+
returns: v4_1.z
|
|
24
|
+
.string()
|
|
25
|
+
.trim()
|
|
26
|
+
.url('enter a URL')
|
|
27
|
+
.transform((value) => {
|
|
28
|
+
return new URL(value);
|
|
29
|
+
}),
|
|
30
|
+
initialValue: (props) => {
|
|
31
|
+
return props.defaultValue ?? '';
|
|
32
|
+
},
|
|
33
|
+
validate: ({ label, props, value }) => {
|
|
34
|
+
const protocol = value.protocol.replace(/:$/, '');
|
|
35
|
+
return props.allowedProtocols.includes(protocol) ? null : `${label} must start with ${props.allowedProtocols.map((allowed) => `${allowed}://`).join(' or ')}.`;
|
|
36
|
+
},
|
|
37
|
+
component: ({ props, value, onChange, disabled, autoFocus, optional }) => {
|
|
38
|
+
return (0, jsx_runtime_1.jsx)(ui_1.Input, { type: "url", inputMode: "url", value: value, onChange: onChange, placeholder: props.placeholder, required: !optional, disabled: disabled, autoFocus: autoFocus });
|
|
39
|
+
},
|
|
40
|
+
});
|
package/dist/ui/ui.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var awaitioComponent=(function(a,l,p,i){"use strict";const u=t=>({kind:"awaitio-component",...t,uiDirectory:null}),s="__AWAITIO__",d=t=>{const e=window[s],n=document.currentScript,o=n instanceof HTMLScriptElement?n.dataset.type:void 0;if(!e||!o)throw new Error("A component UI script must be loaded by the AwaitIO UI.");e.registerComponent(o,t)},m=t=>{const e=window[s],n=document.currentScript,o=n instanceof HTMLScriptElement?n.dataset.type:void 0;if(!e||!o)throw new Error("A display component UI script must be loaded by the AwaitIO UI.");e.registerDisplay(o,t)},w=t=>{const e=window[s],n=document.currentScript,o=n instanceof HTMLScriptElement?n.dataset.type:void 0;if(!e||!o)throw new Error("A layout UI script must be loaded by the AwaitIO UI.");e.registerLayout(o,t)},y=t=>{const e=window[s],n=document.currentScript,o=n instanceof HTMLScriptElement?n.dataset.type:void 0;if(!e||!o)throw new Error("A theme UI script must be loaded by the AwaitIO UI.");e.registerTheme(o,t)},r=u({props:i.z.object({placeholder:i.z.string().optional(),helpText:i.z.string().optional(),defaultValue:i.z.union([i.z.string(),i.z.instanceof(URL)]).transform(t=>t.toString()).optional(),allowedProtocols:i.z.array(i.z.string()).min(1).default(["http","https"])}),returns:i.z.string().trim().url("enter a URL").transform(t=>new URL(t)),initialValue:t=>t.defaultValue??"",validate:({label:t,props:e,value:n})=>{const o=n.protocol.replace(/:$/,"");return e.allowedProtocols.includes(o)?null:`${t} must start with ${e.allowedProtocols.map(c=>`${c}://`).join(" or ")}.`},component:({props:t,value:e,onChange:n,disabled:o,autoFocus:c,optional:f})=>l.jsx(p.Input,{type:"url",inputMode:"url",value:e,onChange:n,placeholder:t.placeholder,required:!f,disabled:o,autoFocus:c})});return Object.values(r).every(t=>t&&t.kind==="awaitio-theme-block")?y({blocks:Object.fromEntries(Object.entries(r).map(([t,e])=>[t,e.component]))}):r.kind==="awaitio-layout"?w({component:r.component}):r.kind==="awaitio-display"?m({component:r.component,wrap:r.wrap??!0}):d({component:r.component,initialValue:r.initialValue,wrap:r.wrap??!0,submitButton:r.submitButton??!0}),a.inputUrl=r,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),a})({},__AWAITIO__.jsxRuntime,__AWAITIO__.ui,__AWAITIO__.zod);
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awaitio/input-url",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "URL input for AwaitIO: io.input.url(), returns a URL.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"zod": "^3.25.0 || ^4.0.0",
|
|
13
|
+
"awaitio": "^0.1.0"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"react": "^19.1.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^22.14.0",
|
|
20
|
+
"@types/react": "^19.1.0",
|
|
21
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
22
|
+
"@vitejs/plugin-react": "^5.0.0",
|
|
23
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
24
|
+
"vite": "^7.1.0",
|
|
25
|
+
"vitest": "^3.2.0",
|
|
26
|
+
"zod": "^4.3.6",
|
|
27
|
+
"awaitio": "0.1.0"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && vite build",
|
|
31
|
+
"dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput & vite build --watch",
|
|
32
|
+
"tsc": "tsc --noEmit",
|
|
33
|
+
"lint": "eslint .",
|
|
34
|
+
"lint:fix": "eslint . --fix",
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"release": "pnpm build && pnpm publish --access public --no-git-checks"
|
|
37
|
+
}
|
|
6
38
|
}
|