@things-factory/auth-ui 8.0.0 → 9.0.0-beta.3

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.
Files changed (99) hide show
  1. package/dist-client/components/abstract-auth-page.js +10 -10
  2. package/dist-client/components/abstract-auth-page.js.map +1 -1
  3. package/dist-client/components/abstract-password-reset.d.ts +1 -2
  4. package/dist-client/components/abstract-password-reset.js +7 -14
  5. package/dist-client/components/abstract-password-reset.js.map +1 -1
  6. package/dist-client/components/abstract-sign.js +12 -11
  7. package/dist-client/components/abstract-sign.js.map +1 -1
  8. package/dist-client/components/contact-us.d.ts +1 -1
  9. package/dist-client/components/contact-us.js +10 -7
  10. package/dist-client/components/contact-us.js.map +1 -1
  11. package/dist-client/components/create-user.js +28 -5
  12. package/dist-client/components/create-user.js.map +1 -1
  13. package/dist-client/components/invite-user.js +19 -11
  14. package/dist-client/components/invite-user.js.map +1 -1
  15. package/dist-client/components/ownership-transfer-popup.js +3 -3
  16. package/dist-client/components/ownership-transfer-popup.js.map +1 -1
  17. package/dist-client/components/profile-component.d.ts +5 -1
  18. package/dist-client/components/profile-component.js +64 -4
  19. package/dist-client/components/profile-component.js.map +1 -1
  20. package/dist-client/components/role-privilege-editor.js +2 -1
  21. package/dist-client/components/role-privilege-editor.js.map +1 -1
  22. package/dist-client/components/user-role-editor.js +18 -18
  23. package/dist-client/components/user-role-editor.js.map +1 -1
  24. package/dist-client/entries/auth/checkin.js +1 -1
  25. package/dist-client/entries/auth/checkin.js.map +1 -1
  26. package/dist-client/entries/auth/forgot-password.js +11 -2
  27. package/dist-client/entries/auth/forgot-password.js.map +1 -1
  28. package/dist-client/entries/auth/signup.js +13 -7
  29. package/dist-client/entries/auth/signup.js.map +1 -1
  30. package/dist-client/index.js +1 -1
  31. package/dist-client/index.js.map +1 -1
  32. package/dist-client/pages/user/user-management.d.ts +5 -1
  33. package/dist-client/pages/user/user-management.js +6 -7
  34. package/dist-client/pages/user/user-management.js.map +1 -1
  35. package/dist-client/tsconfig.tsbuildinfo +1 -1
  36. package/package.json +12 -12
  37. package/translations/en.json +6 -2
  38. package/translations/ja.json +6 -2
  39. package/translations/ko.json +6 -2
  40. package/translations/ms.json +6 -2
  41. package/translations/zh.json +6 -2
  42. package/client/auth-style-sign.ts +0 -194
  43. package/client/bootstrap.ts +0 -51
  44. package/client/components/abstract-auth-page.ts +0 -301
  45. package/client/components/abstract-password-reset.ts +0 -168
  46. package/client/components/abstract-sign.ts +0 -127
  47. package/client/components/change-password.ts +0 -153
  48. package/client/components/contact-us.ts +0 -113
  49. package/client/components/create-domain-popup.ts +0 -141
  50. package/client/components/create-role.ts +0 -123
  51. package/client/components/create-user.ts +0 -95
  52. package/client/components/credential-manager.ts +0 -64
  53. package/client/components/delete-user-popup.ts +0 -117
  54. package/client/components/domain-switch.ts +0 -127
  55. package/client/components/invite-customer.ts +0 -104
  56. package/client/components/invite-user.ts +0 -96
  57. package/client/components/my-login-history.ts +0 -101
  58. package/client/components/ownership-transfer-popup.ts +0 -110
  59. package/client/components/partner-info-card.ts +0 -89
  60. package/client/components/partner-role-editor.ts +0 -153
  61. package/client/components/profile-component.ts +0 -332
  62. package/client/components/role-edit-form.ts +0 -92
  63. package/client/components/role-privilege-editor.ts +0 -267
  64. package/client/components/role-selector.ts +0 -102
  65. package/client/components/user-role-editor.ts +0 -499
  66. package/client/constants/application.ts +0 -9
  67. package/client/constants/index.ts +0 -1
  68. package/client/entries/auth/activate.ts +0 -272
  69. package/client/entries/auth/checkin.ts +0 -190
  70. package/client/entries/auth/forgot-password.ts +0 -103
  71. package/client/entries/auth/reset-password.ts +0 -22
  72. package/client/entries/auth/result.ts +0 -193
  73. package/client/entries/auth/signin.ts +0 -18
  74. package/client/entries/auth/signup.ts +0 -109
  75. package/client/entries/auth/unlock-user.ts +0 -22
  76. package/client/entries/oauth2/oauth2-decision-error-page.ts +0 -50
  77. package/client/entries/oauth2/oauth2-decision-page.ts +0 -196
  78. package/client/entries/public/home.ts +0 -246
  79. package/client/index.ts +0 -124
  80. package/client/pages/app-binding/app-binding.ts +0 -423
  81. package/client/pages/app-binding/app-bindings.ts +0 -171
  82. package/client/pages/appliance/appliance.ts +0 -452
  83. package/client/pages/appliance/home.ts +0 -177
  84. package/client/pages/appliance/register.ts +0 -183
  85. package/client/pages/application/application.ts +0 -428
  86. package/client/pages/application/applications.ts +0 -182
  87. package/client/pages/application/register.ts +0 -211
  88. package/client/pages/attribute/attribute-set-item-list.ts +0 -237
  89. package/client/pages/attribute/attribute-set-management.ts +0 -282
  90. package/client/pages/auth-provider/auth-provider-management.ts +0 -381
  91. package/client/pages/domain/domain-management.ts +0 -410
  92. package/client/pages/partner/partner-management.ts +0 -112
  93. package/client/pages/profile.ts +0 -32
  94. package/client/pages/role/role-management.ts +0 -134
  95. package/client/pages/user/user-management.ts +0 -224
  96. package/client/route.ts +0 -67
  97. package/client/themes/auth-theme.css +0 -65
  98. package/client/utils/password-rule.ts +0 -37
  99. package/server/index.ts +0 -0
@@ -1,246 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@material/web/button/text-button.js'
3
- import '@material/web/button/elevated-button.js'
4
-
5
- import { css, html, LitElement } from 'lit'
6
- import { customElement, property, query } from 'lit/decorators.js'
7
- import { ifDefined } from 'lit/directives/if-defined.js'
8
-
9
- import { i18next, localize } from '@operato/i18n'
10
-
11
- @customElement('home-page')
12
- export class HomePage extends localize(i18next)(LitElement) {
13
- static styles = [
14
- css`
15
- :host {
16
- display: block;
17
- position: relative;
18
- }
19
-
20
- .signin {
21
- position: absolute;
22
- right: 20px;
23
- top: 10px;
24
- display: inline-block;
25
- padding: 12px 24px;
26
- font-size: 16px;
27
- font-weight: bold;
28
- color: var(--md-sys-color-on-tertiary-container);
29
- background-color: var(--md-sys-color-tertiary-container);
30
- border: none;
31
- border-radius: 4px;
32
- text-align: center;
33
- text-decoration: none;
34
- transition:
35
- background-color 0.3s,
36
- transform 0.3s;
37
- }
38
-
39
- .signin:hover {
40
- color: var(--md-sys-color-tertiary-container);
41
- background-color: var(--md-sys-color-on-tertiary-container);
42
- transform: translateY(-2px);
43
- }
44
-
45
- .signin:active {
46
- color: var(--md-sys-color-on-tertiary-container);
47
- background-color: var(--md-sys-color-tertiary-container);
48
- transform: translateY(0);
49
- }
50
-
51
- [message] {
52
- background-color: var(--md-sys-color-secondary-container);
53
- padding: 60px 50px 0 50px;
54
- color: var(--md-sys-color-on-secondary-container);
55
- text-align: center;
56
- font-size: 20px;
57
- }
58
-
59
- [message] strong {
60
- display: block;
61
- font-size: 2.5rem;
62
- }
63
-
64
- [message] img {
65
- width: 800px;
66
- max-width: 90%;
67
- display: block;
68
- margin: auto;
69
- margin-top: -15px;
70
- }
71
-
72
- [ticket] {
73
- display: grid;
74
- grid-template-columns: 96px 1fr;
75
- width: 450px;
76
- margin: auto;
77
- margin-top: -20px;
78
- margin-bottom: 60px;
79
- }
80
-
81
- [brand] {
82
- display: flex;
83
- justify-content: center;
84
- align-items: center;
85
- border-radius: 12px;
86
- overflow: hidden;
87
- background-color: var(--md-sys-color-primary);
88
- box-shadow: var(--box-shadow);
89
- border-right: 3px dotted var(--md-sys-color-secondary-container);
90
- text-align: center;
91
- }
92
-
93
- [ticket] [content] {
94
- border-radius: 12px;
95
- background-color: var(--md-sys-color-tertiary-container);
96
- padding: var(--spacing-medium) var(--spacing-large);
97
- box-shadow: var(--box-shadow);
98
- }
99
-
100
- fieldset {
101
- border: none;
102
- margin: 0;
103
- padding: 0;
104
- }
105
-
106
- legend {
107
- margin: 0;
108
- padding: var(--spacing-small) 0 var(--spacing-medium) 0;
109
- font-weight: bold;
110
- color: var(--legend-color);
111
- text-transform: uppercase;
112
- }
113
-
114
- input {
115
- border: var(--md-sys-color-outline);
116
- border-radius: var(--border-radius);
117
- padding: var(--spacing-medium);
118
- font: var(--input-font);
119
- }
120
-
121
- input[type='text'] {
122
- min-width: 190px;
123
- }
124
-
125
- input:focus {
126
- outline: none;
127
- }
128
-
129
- @media screen and (max-width: 480px) {
130
- [message] {
131
- padding: 60px 10px 0 10px;
132
- text-align: center;
133
- font-size: 14px;
134
- }
135
- [message] strong {
136
- margin-bottom: 15px;
137
- font-size: 1.6rem;
138
- line-height: 1.2em;
139
- }
140
- [message] img {
141
- max-width: 100%;
142
- }
143
-
144
- legend {
145
- padding: 0;
146
- }
147
-
148
- [ticket] {
149
- display: grid;
150
- grid-template-columns: 0 1fr;
151
- width: 90%;
152
- margin: auto;
153
- margin-top: -15px;
154
- margin-bottom: 60px;
155
- }
156
- [brand] {
157
- border: 0;
158
- }
159
- [content] {
160
- border: 1px solid var(--md-sys-color-primary);
161
- }
162
-
163
- fieldset {
164
- text-align: center;
165
- }
166
- input[type='text'] {
167
- width: calc(100% - 20px);
168
- margin: var(--spacing-small) 0 var(--spacing-medium) 0;
169
- text-align: center;
170
- }
171
- fieldset md-text-button {
172
- width: 100%;
173
- }
174
- }
175
- `
176
- ]
177
-
178
- @property({ type: String, attribute: true }) tagline?: string
179
- @property({ type: String, attribute: true }) explanation1?: string
180
- @property({ type: String, attribute: true }) explanation2?: string
181
-
182
- private _applicationMeta?: { icon?: string; title?: string; description?: string }
183
-
184
- render() {
185
- var { icon, title } = this.applicationMeta
186
-
187
- const tagline = this.tagline || `Join the ${title} Business Program`
188
- const explanation1 = this.explanation1 || 'Create your free account today.'
189
- const explanation2 = this.explanation2 || 'Everything you need to go from where you are, to where you want to be.'
190
-
191
- return html`
192
- <a
193
- class="signin"
194
- @click=${e => {
195
- e.preventDefault()
196
- window.location.href = '/auth/signin'
197
- }}
198
- >
199
- ${i18next.t('button.sign_in')}</a
200
- >
201
-
202
- <div message>
203
- <strong>${tagline}</strong> ${explanation1} <br />
204
- ${explanation2}
205
- <img src="/assets/images/invitation.png" />
206
- </div>
207
-
208
- <div ticket>
209
- <div brand><img src=${ifDefined(icon)} /></div>
210
- <div content>
211
- <form action="/auth/join" accept-charset="utf-8" name="join" method="post">
212
- <fieldset>
213
- <legend>${title} invitation ticket</legend>
214
- <input type="text" name="email" placeholder="Enter your email address" />
215
- <input type="submit" value="join now" />
216
- </fieldset>
217
- </form>
218
- </div>
219
- </div>
220
- `
221
- }
222
-
223
- @query('input[type=text]') firstInput!: HTMLInputElement
224
-
225
- firstUpdated() {
226
- setTimeout(() => {
227
- this.firstInput.focus()
228
- }, 100)
229
- }
230
-
231
- get applicationMeta() {
232
- if (!this._applicationMeta) {
233
- var iconLink: HTMLLinkElement | null = document.querySelector('link[rel="application-icon"]')
234
- var titleMeta: HTMLMetaElement | null = document.querySelector('meta[name="application-name"]')
235
- var descriptionMeta: HTMLMetaElement | null = document.querySelector('meta[name="application-description"]')
236
-
237
- this._applicationMeta = {
238
- icon: iconLink?.href,
239
- title: titleMeta ? titleMeta.content : 'Things Factory',
240
- description: descriptionMeta ? descriptionMeta.content : 'Reimagining Software'
241
- }
242
- }
243
-
244
- return this._applicationMeta
245
- }
246
- }
package/client/index.ts DELETED
@@ -1,124 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/i18n/ox-i18n.js'
3
-
4
- import { html } from 'lit-html'
5
-
6
- import { navigate, store } from '@operato/shell'
7
- import { ADD_MORENDA } from '@things-factory/more-base/client'
8
- import { hasPrivilege } from '@things-factory/auth-base/dist-client'
9
-
10
- export * from './components/role-selector.js'
11
- export * from './components/domain-switch.js'
12
- export * from './components/invite-user.js'
13
-
14
- export type AuthManagementMenuOptions = {
15
- role?: boolean
16
- appliance?: boolean
17
- application?: boolean
18
- user?: boolean
19
- authProvider?: boolean
20
- domain?: boolean
21
- attribute?: boolean
22
- }
23
-
24
- export async function setAuthManagementMenus(options?: any) {
25
- const {
26
- role = true,
27
- appliance = true,
28
- application = true,
29
- user = true,
30
- authProvider = true,
31
- domain = true,
32
- attribute = true
33
- } = options || {}
34
-
35
- if (
36
- await hasPrivilege({ privilege: 'mutation', category: 'user', domainOwnerGranted: true, superUserGranted: true })
37
- ) {
38
- role &&
39
- store.dispatch({
40
- type: ADD_MORENDA,
41
- morenda: {
42
- icon: html` <md-icon>how_to_reg</md-icon> `,
43
- name: html` <ox-i18n msgid="text.role_management"></ox-i18n> `,
44
- action: () => {
45
- navigate('roles')
46
- }
47
- }
48
- })
49
-
50
- appliance &&
51
- store.dispatch({
52
- type: ADD_MORENDA,
53
- morenda: {
54
- icon: html` <md-icon>devices</md-icon> `,
55
- name: html` <ox-i18n msgid="text.appliance"></ox-i18n> `,
56
- action: () => {
57
- navigate('appliance-home')
58
- }
59
- }
60
- })
61
-
62
- application &&
63
- store.dispatch({
64
- type: ADD_MORENDA,
65
- morenda: {
66
- icon: html` <md-icon>apps</md-icon> `,
67
- name: html` <ox-i18n msgid="text.application management"></ox-i18n> `,
68
- action: () => {
69
- navigate('applications')
70
- }
71
- }
72
- })
73
-
74
- user &&
75
- store.dispatch({
76
- type: ADD_MORENDA,
77
- morenda: {
78
- icon: html` <md-icon>people</md-icon> `,
79
- name: html` <ox-i18n msgid="text.user management"></ox-i18n> `,
80
- action: () => {
81
- navigate('users')
82
- }
83
- }
84
- })
85
-
86
- authProvider &&
87
- store.dispatch({
88
- type: ADD_MORENDA,
89
- morenda: {
90
- icon: html` <md-icon>badge</md-icon> `,
91
- name: html` <ox-i18n msgid="text.auth-provider management"></ox-i18n> `,
92
- action: () => {
93
- navigate('auth-providers')
94
- }
95
- }
96
- })
97
- }
98
-
99
- if (await hasPrivilege({ superUserGranted: true })) {
100
- domain &&
101
- store.dispatch({
102
- type: ADD_MORENDA,
103
- morenda: {
104
- icon: html` <md-icon>business</md-icon> `,
105
- name: html` <ox-i18n msgid="text.domain management"></ox-i18n> `,
106
- action: () => {
107
- navigate('domains')
108
- }
109
- }
110
- })
111
-
112
- attribute &&
113
- store.dispatch({
114
- type: ADD_MORENDA,
115
- morenda: {
116
- icon: html` <md-icon>dataset</md-icon> `,
117
- name: html` <ox-i18n msgid="text.attribute management"></ox-i18n> `,
118
- action: () => {
119
- navigate('attributes')
120
- }
121
- }
122
- })
123
- }
124
- }