Skip to content

Releases: wpdas/near-social-bridge

v1.3.3

18 Apr 14:44
Compare
Choose a tag to compare

v1.3.2

17 Apr 23:57
Compare
Choose a tag to compare
  • auth: set initial accountId

v1.3.1

17 Apr 23:01
Compare
Choose a tag to compare
  • testnet support

v1.3.0

17 Apr 00:44
Compare
Choose a tag to compare
  • Support to Server-side Rendering;
  • Now, it's necessary to import the near-social-bridge.css to the main application;
  • Fixed an error that occurred when a new route was requested and the properties of the previous route were lost before changing the screen;
  • Performance improvement;
  • Auto iframe height resizer added (own solution);
  • When using Navigator with autoHeightSync set as true, the height of the iframe is automatically adjusted to the initial screen content. If more content is inserted inside the screen after the first render, you can use useSyncContentHeight hook to sync the height again;
  • Added useSyncContentHeight hook:

You can use this hook to do a content height sync. Thus, the height of the viewer's iframe will always have the updated height.

import { useSyncContentHeight } from 'near-social-bridge'

const MyComponent = () => {
  const { done, syncAgain } = useSyncContentHeight()
  console.log('is sync done?', done)

  const [list, setList] = useState(['a'])

  useEffect(() => {
    setList(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k'])
    syncAgain()
  }, [])

  return (
    <div className="flex flex-col">
      <p>list</p>
      {list.map((item) => (
        <p key={item}>{item}</p>
      ))}
    </div>
  )
}

Or, you can just use useSyncContentHeight():

import { useSyncContentHeight } from 'near-social-bridge'

const MyComponent = () => {
  useSyncContentHeight()

  const list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k']

  return (
    <div className="flex flex-col">
      <p>list</p>
      {list.map((item) => (
        <p key={item}>{item}</p>
      ))}
    </div>
  )
}

v1.2.5

12 Apr 06:11
Compare
Choose a tag to compare

v1.2.4

11 Apr 03:28
Compare
Choose a tag to compare

v1.2.3

07 Apr 12:54
Compare
Choose a tag to compare
  • Fixed issue with request/index.ts which was generating a strange and defective module.

v1.2.1

07 Apr 11:53
Compare
Choose a tag to compare
  • Fixed mock issue that prevented viewer height from syncing

v1.2.0

07 Apr 10:37
affd70b
Compare
Choose a tag to compare
  • Fixed issue where localStorage was not available inside VM
  • Fixed bug where hydrate-view request was failing
  • Auto refresh fixed
  • Added Spinner to be used as default Fallback
  • Added a palliative feature to fix a bug that happens with react.
    When content inside an iframe is updated, react adds an iframe covering the entire
    screen using the maximum z-index, thus making any interaction with the application impossible.
  • Widget NearSocialBridgeCore updated. An issue while fetching data with Storage API was fixed.
    The Utils.promisify method was also updated, now it's possible to set the timeout manually.
  • Added Spinner component to be used as default Fallback for createStackNavigator and NearSocialBridgeProvider.

E.g:

var myTimeout = 3000; // 3 sec
Utils.promisify(() => getCachedObject(), (res) => console.log(res), (err) => console.log(err), myTimeout)

v1.1.0

03 Apr 08:17
Compare
Choose a tag to compare
  • feature mockInitialPayload added

During the development, use mockInitialPayload to mock the initial payload (sent by the Widget).

// Mock
import { mockInitialPayload } from 'near-social-bridge'

mockInitialPayload({
  defaultRoom: 'dragon-ball-z',
})

// App
import { useInitialPayload } from 'near-social-bridge/hooks'

const MyComponent = () => {
  const { defaultRoom } = useInitialPayload() // 'dragon-ball-z'
}