@amityco/ulta-ui-kit 1.0.0-alpha.3 → 1.0.0-alpha.30

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 (116) hide show
  1. package/dist/CircularStd-Black-EL754VZN.eot +0 -0
  2. package/dist/CircularStd-Black-M6FYDJME.woff2 +0 -0
  3. package/dist/CircularStd-Black-PNLLRW5C.woff +0 -0
  4. package/dist/CircularStd-Black-YMQQKCA3.ttf +0 -0
  5. package/dist/CircularStd-BlackItalic-BWOJUVN3.ttf +0 -0
  6. package/dist/CircularStd-BlackItalic-G62XUQUP.woff2 +0 -0
  7. package/dist/CircularStd-BlackItalic-MBNBDZUU.eot +0 -0
  8. package/dist/CircularStd-BlackItalic-NVQVXG5L.woff +0 -0
  9. package/dist/CircularStd-Bold-3YZD2D54.woff +0 -0
  10. package/dist/CircularStd-Bold-OBIX2X7G.woff2 +0 -0
  11. package/dist/CircularStd-Bold-QHAMEMSL.eot +0 -0
  12. package/dist/CircularStd-Bold-UGQNNLCJ.ttf +0 -0
  13. package/dist/CircularStd-BoldItalic-53VUNMNP.ttf +0 -0
  14. package/dist/CircularStd-BoldItalic-7MYBAB7V.woff2 +0 -0
  15. package/dist/CircularStd-BoldItalic-A6ZIS4PA.eot +0 -0
  16. package/dist/CircularStd-BoldItalic-S4EXYNAA.woff +0 -0
  17. package/dist/CircularStd-Book-JPHT3EYH.eot +0 -0
  18. package/dist/CircularStd-Book-QH24MWNT.woff2 +0 -0
  19. package/dist/CircularStd-Book-WO57ECZG.woff +0 -0
  20. package/dist/CircularStd-Book-X7C7G6T7.ttf +0 -0
  21. package/dist/CircularStd-BookItalic-FKVXO6VC.woff +0 -0
  22. package/dist/CircularStd-BookItalic-JMRK2M3F.ttf +0 -0
  23. package/dist/CircularStd-BookItalic-LYDC7HJ5.eot +0 -0
  24. package/dist/CircularStd-BookItalic-N7R5KSUJ.woff2 +0 -0
  25. package/dist/CircularStd-Medium-27RJ4G7E.woff +0 -0
  26. package/dist/CircularStd-Medium-CYDQT5MI.eot +0 -0
  27. package/dist/CircularStd-Medium-MVVUHW3Z.woff2 +0 -0
  28. package/dist/CircularStd-Medium-TPGRKUIA.ttf +0 -0
  29. package/dist/CircularStd-MediumItalic-6VIHMKHS.woff +0 -0
  30. package/dist/CircularStd-MediumItalic-MGFTUSP5.woff2 +0 -0
  31. package/dist/CircularStd-MediumItalic-PWSPA5NY.ttf +0 -0
  32. package/dist/CircularStd-MediumItalic-QZO45QYZ.eot +0 -0
  33. package/dist/esm/CircularStd-Black-EL754VZN.eot +0 -0
  34. package/dist/esm/CircularStd-Black-M6FYDJME.woff2 +0 -0
  35. package/dist/esm/CircularStd-Black-PNLLRW5C.woff +0 -0
  36. package/dist/esm/CircularStd-Black-YMQQKCA3.ttf +0 -0
  37. package/dist/esm/CircularStd-BlackItalic-BWOJUVN3.ttf +0 -0
  38. package/dist/esm/CircularStd-BlackItalic-G62XUQUP.woff2 +0 -0
  39. package/dist/esm/CircularStd-BlackItalic-MBNBDZUU.eot +0 -0
  40. package/dist/esm/CircularStd-BlackItalic-NVQVXG5L.woff +0 -0
  41. package/dist/esm/CircularStd-Bold-3YZD2D54.woff +0 -0
  42. package/dist/esm/CircularStd-Bold-OBIX2X7G.woff2 +0 -0
  43. package/dist/esm/CircularStd-Bold-QHAMEMSL.eot +0 -0
  44. package/dist/esm/CircularStd-Bold-UGQNNLCJ.ttf +0 -0
  45. package/dist/esm/CircularStd-BoldItalic-53VUNMNP.ttf +0 -0
  46. package/dist/esm/CircularStd-BoldItalic-7MYBAB7V.woff2 +0 -0
  47. package/dist/esm/CircularStd-BoldItalic-A6ZIS4PA.eot +0 -0
  48. package/dist/esm/CircularStd-BoldItalic-S4EXYNAA.woff +0 -0
  49. package/dist/esm/CircularStd-Book-JPHT3EYH.eot +0 -0
  50. package/dist/esm/CircularStd-Book-QH24MWNT.woff2 +0 -0
  51. package/dist/esm/CircularStd-Book-WO57ECZG.woff +0 -0
  52. package/dist/esm/CircularStd-Book-X7C7G6T7.ttf +0 -0
  53. package/dist/esm/CircularStd-BookItalic-FKVXO6VC.woff +0 -0
  54. package/dist/esm/CircularStd-BookItalic-JMRK2M3F.ttf +0 -0
  55. package/dist/esm/CircularStd-BookItalic-LYDC7HJ5.eot +0 -0
  56. package/dist/esm/CircularStd-BookItalic-N7R5KSUJ.woff2 +0 -0
  57. package/dist/esm/CircularStd-Medium-27RJ4G7E.woff +0 -0
  58. package/dist/esm/CircularStd-Medium-CYDQT5MI.eot +0 -0
  59. package/dist/esm/CircularStd-Medium-MVVUHW3Z.woff2 +0 -0
  60. package/dist/esm/CircularStd-Medium-TPGRKUIA.ttf +0 -0
  61. package/dist/esm/CircularStd-MediumItalic-6VIHMKHS.woff +0 -0
  62. package/dist/esm/CircularStd-MediumItalic-MGFTUSP5.woff2 +0 -0
  63. package/dist/esm/CircularStd-MediumItalic-PWSPA5NY.ttf +0 -0
  64. package/dist/esm/CircularStd-MediumItalic-QZO45QYZ.eot +0 -0
  65. package/dist/esm/index.css +1 -1
  66. package/dist/esm/index.js +2796 -1829
  67. package/dist/index.css +1 -1
  68. package/dist/index.d.mts +246 -283
  69. package/dist/index.d.ts +246 -283
  70. package/dist/index.js +2875 -1903
  71. package/dist/metafile-cjs.json +1 -1
  72. package/dist/metafile-esm.json +1 -1
  73. package/package.json +4 -5
  74. package/readme.md +130 -10
  75. package/dist/Inter-Black-PFV6RWF7.woff2 +0 -0
  76. package/dist/Inter-BlackItalic-OUXR4CVK.woff2 +0 -0
  77. package/dist/Inter-Bold-K6PA7FOK.woff2 +0 -0
  78. package/dist/Inter-BoldItalic-QKFESTQE.woff2 +0 -0
  79. package/dist/Inter-ExtraBold-2ZPQFALF.woff2 +0 -0
  80. package/dist/Inter-ExtraBoldItalic-RR7KYXHD.woff2 +0 -0
  81. package/dist/Inter-ExtraLight-NASBO7I6.woff2 +0 -0
  82. package/dist/Inter-ExtraLightItalic-AUJY3XPT.woff2 +0 -0
  83. package/dist/Inter-Italic-2WJ2RX3Z.woff2 +0 -0
  84. package/dist/Inter-Light-E4ED7JRX.woff2 +0 -0
  85. package/dist/Inter-LightItalic-BJ4DXCNT.woff2 +0 -0
  86. package/dist/Inter-Medium-3R4SWUEO.woff2 +0 -0
  87. package/dist/Inter-MediumItalic-QTJUSOU7.woff2 +0 -0
  88. package/dist/Inter-Regular-6HYMGWZS.woff2 +0 -0
  89. package/dist/Inter-SemiBold-7SYQBR3A.woff2 +0 -0
  90. package/dist/Inter-SemiBoldItalic-3EHSSXIM.woff2 +0 -0
  91. package/dist/Inter-Thin-3L5KITMZ.woff2 +0 -0
  92. package/dist/Inter-ThinItalic-J7DGFM6P.woff2 +0 -0
  93. package/dist/Inter-italic.var-SWFAXF2C.woff2 +0 -0
  94. package/dist/Inter-roman.var-WIJJYAE4.woff2 +0 -0
  95. package/dist/Inter.var-OMHIC2JW.woff2 +0 -0
  96. package/dist/esm/Inter-Black-PFV6RWF7.woff2 +0 -0
  97. package/dist/esm/Inter-BlackItalic-OUXR4CVK.woff2 +0 -0
  98. package/dist/esm/Inter-Bold-K6PA7FOK.woff2 +0 -0
  99. package/dist/esm/Inter-BoldItalic-QKFESTQE.woff2 +0 -0
  100. package/dist/esm/Inter-ExtraBold-2ZPQFALF.woff2 +0 -0
  101. package/dist/esm/Inter-ExtraBoldItalic-RR7KYXHD.woff2 +0 -0
  102. package/dist/esm/Inter-ExtraLight-NASBO7I6.woff2 +0 -0
  103. package/dist/esm/Inter-ExtraLightItalic-AUJY3XPT.woff2 +0 -0
  104. package/dist/esm/Inter-Italic-2WJ2RX3Z.woff2 +0 -0
  105. package/dist/esm/Inter-Light-E4ED7JRX.woff2 +0 -0
  106. package/dist/esm/Inter-LightItalic-BJ4DXCNT.woff2 +0 -0
  107. package/dist/esm/Inter-Medium-3R4SWUEO.woff2 +0 -0
  108. package/dist/esm/Inter-MediumItalic-QTJUSOU7.woff2 +0 -0
  109. package/dist/esm/Inter-Regular-6HYMGWZS.woff2 +0 -0
  110. package/dist/esm/Inter-SemiBold-7SYQBR3A.woff2 +0 -0
  111. package/dist/esm/Inter-SemiBoldItalic-3EHSSXIM.woff2 +0 -0
  112. package/dist/esm/Inter-Thin-3L5KITMZ.woff2 +0 -0
  113. package/dist/esm/Inter-ThinItalic-J7DGFM6P.woff2 +0 -0
  114. package/dist/esm/Inter-italic.var-SWFAXF2C.woff2 +0 -0
  115. package/dist/esm/Inter-roman.var-WIJJYAE4.woff2 +0 -0
  116. package/dist/esm/Inter.var-OMHIC2JW.woff2 +0 -0
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@amityco/ulta-ui-kit",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.30",
4
4
  "engines": {
5
- "node": ">=20",
6
- "pnpm": "9"
5
+ "node": ">=18"
7
6
  },
8
7
  "module": "dist/esm/index.js",
9
8
  "main": "dist/index.js",
@@ -25,12 +24,12 @@
25
24
  "types": "dist/index.d.ts",
26
25
  "description": "React Ui-Kit for Amity Social Cloud",
27
26
  "peerDependencies": {
28
- "@amityco/ts-sdk": "6.29.2-ad0d097.0",
27
+ "@amityco/ts-sdk": "^6.30.0",
29
28
  "react": ">=17.0.2",
30
29
  "react-dom": ">=17.0.2"
31
30
  },
32
31
  "devDependencies": {
33
- "@amityco/ts-sdk": "6.29.2-ad0d097.0",
32
+ "@amityco/ts-sdk": "6.30.0",
34
33
  "@eslint/js": "^9.4.0",
35
34
  "@storybook/addon-a11y": "^7.6.7",
36
35
  "@storybook/addon-actions": "^7.6.7",
package/readme.md CHANGED
@@ -1,21 +1,141 @@
1
- # Amity Ui-Kit for Web
1
+ # Ulta-Social-Cloud-Ui-Kit for Web
2
2
 
3
3
  ## Getting started
4
4
 
5
- Before starting to work, please read the following instructions.
6
- https://ekoapp.atlassian.net/wiki/spaces/UP/pages/2443706407/ASC+Web+UIKit+V4+Governance
5
+ The AmityUIKit provides a comprehensive user interface toolkit to quickly integrate Amity Social features into new or existing websites. This toolkit simplifies the incorporation of social interactions within your projects through an iframe-based integration.
7
6
 
8
- If you have any questions, please ask / discuss with the team.
7
+ ### Prerequisites
8
+
9
+ Before you begin, ensure you have the following installed:
10
+
11
+ • Node.js (>= 20.x)
12
+ • React.js (>= 18.x)
9
13
 
10
14
  ### Installation
11
15
 
12
- 1. `npm install --save @amityco/ui-kit`
13
- 2. `yarn add @amityco/ui-kit`
16
+ With npm: `npm install --save @amityco/ulta-ui-kit`
17
+
18
+ With yarn: `yarn add @amityco/ulta-ui-kit`
19
+
20
+ ### Basic Usage
21
+
22
+ ```sh
23
+ import { AmityUiKitProvider, AmityUiKitSocial } from "@amityco/ulta-ui-kit";
24
+
25
+ import "@amityco/ulta-ui-kit/dist/index.css";
26
+
27
+ export default function App() {
28
+ // Retrieve userId from query parameters
29
+ const urlParams = new URLSearchParams(window.location.search);
30
+ const userId = urlParams.get("userId");
31
+ const apiKey = "<your API key here>";
32
+ const apiRegion = "<your API region here>";
33
+
34
+ return (
35
+ <div className="App">
36
+ <AmityUiKitProvider
37
+ apiKey={apiKey}
38
+ userId={userId}
39
+ apiRegion={apiRegion}
40
+ >
41
+ <AmityUiKitSocial />
42
+ </AmityUiKitProvider>
43
+ </div>
44
+ );
45
+ }
46
+ ```
47
+
48
+ ### Iframe Post Message Integration
49
+
50
+ In React, the component’s state dictates the behavior and rendering of the component. When the state changes, React automatically triggers a re-render of the component, updating the DOM where necessary. In your application, the userId is stored in the component’s state using the useState hook. This state determines the URL of the iframe where the Amity UIKit is loaded. When the userId state changes, React recognizes this change and re-renders the component, including the iframe, with the updated URL.
51
+
52
+ When an anonymous user exceeds three clicks, the UIKit will emit a ‘anonymousNeedsLogin’ postMessage event. Below is a code example demonstrating how to receive this postMessage event from the UIKit Iframe:
53
+
54
+ ```sh
55
+ import React, { useState, useEffect } from 'react';
56
+
57
+ export default function App() {
58
+ // `userId` is managed as a state variable and will be updated post-login
59
+ const [userId, setUserId] = useState('anonymous-xxxx');
60
+
61
+ // Handle the postMessage event from the iframe
62
+ useEffect(() => {
63
+ const handleIframeMessage = event => {
64
+ if (event.data === 'anonymousNeedsLogin') {
65
+ // Prompt user to log in
66
+ // Logic to display login dialog should be implemented here
67
+ }
68
+ };
69
+
70
+ // Listen for messages from the iframe
71
+ window.addEventListener('message', handleIframeMessage);
72
+
73
+ // Cleanup the event listener on component unmount
74
+ return () => {
75
+ window.removeEventListener('message', handleIframeMessage);
76
+ };
77
+ }, []);
78
+
79
+ // Function to handle setting a new `userId` after the user logs in
80
+ const handleSetUserId = newValue => {
81
+ setUserId(newValue);
82
+ };
83
+
84
+ return (
85
+ <div>
86
+ // Assume that this is Ulta login prompt
87
+ <input
88
+ type="text"
89
+ id="name"
90
+ placeholder="Enter new User ID"
91
+ onChange={(e) => handleSetUserId(e.target.value)}
92
+ />
93
+ <button onClick={() => handleSetUserId(document.getElementById('name').value)}>
94
+ Set User ID
95
+ </button>
96
+ <iframe
97
+ style={{ width: '100%', height: '80vh' }}
98
+ title="Communities"
99
+ src={`https://urlToUikit.com?userId=${userId}`}
100
+ />
101
+ </div>
102
+ );
103
+ }
104
+ ```
105
+
106
+ ### Anonymous User Flow
107
+
108
+ **Authenticated Users**
109
+
110
+ 1. Access and Authentication:
111
+
112
+ - Users enter Ulta Web and navigate to the community tab.
113
+ - Ulta Web contacts Ulta Authentication Service to verify if the user is logged in.
114
+
115
+ 2. Token Handling:
116
+
117
+ - If authenticated, Ulta Web requests an Amity authentication token from Ulta Server.
118
+ - Ulta Server forwards this request to Amity Server, which returns the token.
119
+
120
+ 3. UIKit Initialization:
121
+
122
+ - Ulta Web instructs Ulta Iframe to initialize Amity UIKit using the authenticated Ulta User ID and token.
123
+ - Amity UIKit is then presented to the user, allowing continued interaction under their Ulta ID.
124
+
125
+ **Anonymous Users**
126
+
127
+ 1. Access as Anonymous:
128
+
129
+ - If not logged in, the same token request is made to handle session management.
130
+ - Amity UIKit is initialized as ‘anonymous’, allowing limited interaction.
131
+
132
+ 2. Exceeded Interaction Limit:
14
133
 
15
- ### Documentation
134
+ - If anonymous interactions exceed limits, Amity UIKit informs Ulta Iframe, triggering a notification to Ulta Web.
135
+ - A login dialogue is presented to the user.
16
136
 
17
- Please refer to our online documentation at https://docs.amity.co or contact a Ui-Kit representative at \* \*developers@amity.co** for support.
137
+ 3. Login Decision:
18
138
 
19
- ## Contributing
139
+ - If the user logs in, Ulta Authentication Service authenticates the user, and the token process repeats to reinitialize Amity UIKit with the Ulta User ID.
20
140
 
21
- See [our contributing guide](https://github.com/EkoCommunications/AmityUiKitWeb/blob/develop/CONTRIBUTING.md)
141
+ ![Diagram Sept 4 from Mermaid Chart (1)](https://github.com/user-attachments/assets/e62d0e3e-4b00-445d-b8ea-cda1b72ab5f0)
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file